2019-12-07 16:58:52 +05:30
|
|
|
import { combineReducers } from 'redux';
|
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
import auth, { State as AuthState } from 'app/components/auth/reducer';
|
|
|
|
import user, { User } from 'app/components/user/reducer';
|
2020-05-24 04:38:24 +05:30
|
|
|
import accounts, { State as AccountsState } from 'app/components/accounts/reducer';
|
2019-12-08 00:32:00 +05:30
|
|
|
import i18n, { State as I18nState } from 'app/components/i18n/reducer';
|
|
|
|
import popup, { State as PopupState } from 'app/components/ui/popup/reducer';
|
2019-12-09 12:37:07 +05:30
|
|
|
import bsod, { State as BsodState } from 'app/components/ui/bsod/reducer';
|
2019-12-08 00:32:00 +05:30
|
|
|
import apps, { Apps } from 'app/components/dev/apps/reducer';
|
2019-12-07 16:58:52 +05:30
|
|
|
import { ThunkDispatch, ThunkAction as ReduxThunkAction } from 'redux-thunk';
|
|
|
|
import { Store as ReduxStore } from 'redux';
|
|
|
|
|
|
|
|
export interface RootState {
|
2020-05-24 04:38:24 +05:30
|
|
|
auth: AuthState;
|
|
|
|
bsod: BsodState;
|
|
|
|
accounts: AccountsState;
|
|
|
|
user: User;
|
|
|
|
popup: PopupState;
|
|
|
|
apps: Apps;
|
|
|
|
i18n: I18nState;
|
2019-12-07 16:58:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export interface Action<T = any> {
|
2020-05-24 04:38:24 +05:30
|
|
|
type: string;
|
|
|
|
payload?: T;
|
2019-12-07 16:58:52 +05:30
|
|
|
}
|
2020-05-24 04:38:24 +05:30
|
|
|
export type Dispatch<T extends Action = Action> = ThunkDispatch<RootState, undefined, T>;
|
2019-12-07 16:58:52 +05:30
|
|
|
export type GetState = () => RootState;
|
2020-05-24 04:38:24 +05:30
|
|
|
export type ThunkAction<T = any> = ReduxThunkAction<T, RootState, undefined, Action>;
|
2019-12-07 16:58:52 +05:30
|
|
|
export type Store = ReduxStore<RootState> & {
|
2020-05-24 04:38:24 +05:30
|
|
|
dispatch: Dispatch;
|
2019-12-07 16:58:52 +05:30
|
|
|
};
|
|
|
|
|
2019-12-09 12:37:07 +05:30
|
|
|
export default combineReducers<RootState>({
|
2020-05-24 04:38:24 +05:30
|
|
|
bsod,
|
|
|
|
auth,
|
|
|
|
user,
|
|
|
|
accounts,
|
|
|
|
i18n,
|
|
|
|
popup,
|
|
|
|
apps,
|
2019-12-07 16:58:52 +05:30
|
|
|
});
|