Use combineReducers as Redux recommends, removing an any
This commit is contained in:
parent
8fd4ff95db
commit
8160b3b160
1 changed files with 14 additions and 81 deletions
|
@ -1,84 +1,18 @@
|
|||
import { combineReducers } from 'redux';
|
||||
|
||||
import {
|
||||
CallingActionType,
|
||||
CallingStateType,
|
||||
reducer as calling,
|
||||
} from './ducks/calling';
|
||||
import {
|
||||
ConversationActionType,
|
||||
ConversationsStateType,
|
||||
reducer as conversations,
|
||||
} from './ducks/conversations';
|
||||
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';
|
||||
import { reducer as user, UserStateType } from './ducks/user';
|
||||
import { reducer as calling } from './ducks/calling';
|
||||
import { reducer as conversations } from './ducks/conversations';
|
||||
import { reducer as emojis } from './ducks/emojis';
|
||||
import { reducer as expiration } from './ducks/expiration';
|
||||
import { reducer as items } from './ducks/items';
|
||||
import { reducer as network } from './ducks/network';
|
||||
import { reducer as safetyNumber } from './ducks/safetyNumber';
|
||||
import { reducer as search } from './ducks/search';
|
||||
import { reducer as stickers } from './ducks/stickers';
|
||||
import { reducer as updates } from './ducks/updates';
|
||||
import { reducer as user } from './ducks/user';
|
||||
|
||||
export type StateType = {
|
||||
calling: CallingStateType;
|
||||
conversations: ConversationsStateType;
|
||||
emojis: EmojisStateType;
|
||||
expiration: ExpirationStateType;
|
||||
items: ItemsStateType;
|
||||
network: NetworkStateType;
|
||||
safetyNumber: SafetyNumberStateType;
|
||||
search: SearchStateType;
|
||||
stickers: StickersStateType;
|
||||
updates: UpdatesStateType;
|
||||
user: UserStateType;
|
||||
};
|
||||
|
||||
export type ActionsType =
|
||||
| CallingActionType
|
||||
| EmojisActionType
|
||||
| ExpirationActionType
|
||||
| ConversationActionType
|
||||
| ItemsActionType
|
||||
| NetworkActionType
|
||||
| SafetyNumberActionType
|
||||
| StickersActionType
|
||||
| SearchActionType
|
||||
| UpdatesActionType;
|
||||
|
||||
export const reducers = {
|
||||
export const reducer = combineReducers({
|
||||
calling,
|
||||
conversations,
|
||||
emojis,
|
||||
|
@ -90,7 +24,6 @@ export const reducers = {
|
|||
stickers,
|
||||
updates,
|
||||
user,
|
||||
};
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const reducer = combineReducers<StateType, ActionsType>(reducers as any);
|
||||
export type StateType = ReturnType<typeof reducer>;
|
||||
|
|
Loading…
Add table
Reference in a new issue