aboutsummaryrefslogtreecommitdiffstats
path: root/src/store.ts
blob: 1b9807b9cff3b1fa5b017a653ddb63e2e76dab15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { combineReducers, configureStore } from "@reduxjs/toolkit";

import authorizationReducer from "./slices/authorization";

const rootReducer = combineReducers({
    authorization: authorizationReducer
});

export const setupStore = (preloadedState?: Partial<RootState>) => {
    return configureStore({
        reducer: rootReducer,
        preloadedState
    });
};

const formsStore = setupStore();

export default formsStore;

export type RootState = ReturnType<typeof rootReducer>
export type AppStore = ReturnType<typeof setupStore>