aboutsummaryrefslogtreecommitdiffstats
path: root/src/store.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/store.ts')
-rw-r--r--src/store.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/store.ts b/src/store.ts
new file mode 100644
index 0000000..1b9807b
--- /dev/null
+++ b/src/store.ts
@@ -0,0 +1,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>