signal-desktop/ts/state/reducer.ts

97 lines
2 KiB
TypeScript
Raw Normal View History

2019-01-14 21:49:58 +00:00
import { combineReducers } from 'redux';
2020-06-04 18:16:19 +00:00
import {
CallingActionType,
CallingStateType,
reducer as calling,
} from './ducks/calling';
2019-01-14 21:49:58 +00:00
import {
ConversationActionType,
2019-01-14 21:49:58 +00:00
ConversationsStateType,
reducer as conversations,
} from './ducks/conversations';
2019-05-24 23:58:27 +00:00
import {
EmojisActionType,
EmojisStateType,
reducer as emojis,
} from './ducks/emojis';
import {
ExpirationActionType,
ExpirationStateType,
reducer as expiration,
} from './ducks/expiration';
import {
ItemsActionType,
ItemsStateType,
reducer as items,
} from './ducks/items';
import {
NetworkActionType,
NetworkStateType,
reducer as network,
} from './ducks/network';
import {
reducer as safetyNumber,
SafetyNumberActionType,
SafetyNumberStateType,
} from './ducks/safetyNumber';
import {
reducer as search,
SearchActionType,
SearchStateType,
} from './ducks/search';
import {
reducer as stickers,
StickersActionType,
StickersStateType,
} from './ducks/stickers';
import {
reducer as updates,
UpdatesActionType,
UpdatesStateType,
} from './ducks/updates';
2019-01-14 21:49:58 +00:00
import { reducer as user, UserStateType } from './ducks/user';
export type StateType = {
2020-06-04 18:16:19 +00:00
calling: CallingStateType;
2019-01-14 21:49:58 +00:00
conversations: ConversationsStateType;
2019-05-24 23:58:27 +00:00
emojis: EmojisStateType;
expiration: ExpirationStateType;
items: ItemsStateType;
network: NetworkStateType;
safetyNumber: SafetyNumberStateType;
search: SearchStateType;
stickers: StickersStateType;
updates: UpdatesStateType;
2019-01-14 21:49:58 +00:00
user: UserStateType;
};
export type ActionsType =
2020-06-04 18:16:19 +00:00
| CallingActionType
2019-05-24 23:58:27 +00:00
| EmojisActionType
| ExpirationActionType
| ConversationActionType
2019-05-24 23:58:27 +00:00
| ItemsActionType
| NetworkActionType
| SafetyNumberActionType
| StickersActionType
| SearchActionType
| UpdatesActionType;
2019-01-14 21:49:58 +00:00
export const reducers = {
2020-06-04 18:16:19 +00:00
calling,
2019-01-14 21:49:58 +00:00
conversations,
2019-05-24 23:58:27 +00:00
emojis,
expiration,
items,
network,
safetyNumber,
search,
stickers,
updates,
2019-01-14 21:49:58 +00:00
user,
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const reducer = combineReducers<StateType, ActionsType>(reducers as any);