2019-01-14 21:49:58 +00:00
|
|
|
import { combineReducers } from 'redux';
|
|
|
|
|
|
|
|
import {
|
2019-05-16 22:32:11 +00:00
|
|
|
ConversationActionType,
|
2019-01-14 21:49:58 +00:00
|
|
|
ConversationsStateType,
|
|
|
|
reducer as conversations,
|
|
|
|
} from './ducks/conversations';
|
2019-05-16 22:32:11 +00:00
|
|
|
import {
|
|
|
|
ItemsActionType,
|
|
|
|
ItemsStateType,
|
|
|
|
reducer as items,
|
|
|
|
} from './ducks/items';
|
|
|
|
import {
|
|
|
|
reducer as search,
|
|
|
|
SEARCH_TYPES as SearchActionType,
|
|
|
|
SearchStateType,
|
|
|
|
} from './ducks/search';
|
|
|
|
import {
|
|
|
|
reducer as stickers,
|
|
|
|
StickersActionType,
|
|
|
|
StickersStateType,
|
|
|
|
} from './ducks/stickers';
|
2019-01-14 21:49:58 +00:00
|
|
|
import { reducer as user, UserStateType } from './ducks/user';
|
|
|
|
|
|
|
|
export type StateType = {
|
|
|
|
conversations: ConversationsStateType;
|
2019-05-16 22:32:11 +00:00
|
|
|
items: ItemsStateType;
|
|
|
|
search: SearchStateType;
|
|
|
|
stickers: StickersStateType;
|
2019-01-14 21:49:58 +00:00
|
|
|
user: UserStateType;
|
|
|
|
};
|
|
|
|
|
2019-05-16 22:32:11 +00:00
|
|
|
export type ActionsType =
|
|
|
|
| ItemsActionType
|
|
|
|
| ConversationActionType
|
|
|
|
| StickersActionType
|
|
|
|
| SearchActionType;
|
|
|
|
|
2019-01-14 21:49:58 +00:00
|
|
|
export const reducers = {
|
|
|
|
conversations,
|
2019-05-16 22:32:11 +00:00
|
|
|
items,
|
|
|
|
search,
|
|
|
|
stickers,
|
2019-01-14 21:49:58 +00:00
|
|
|
user,
|
|
|
|
};
|
|
|
|
|
2019-05-16 22:32:11 +00:00
|
|
|
// @ts-ignore: AnyAction breaks strong type checking inside reducers
|
|
|
|
export const reducer = combineReducers<StateType, ActionsType>(reducers);
|