first commit
This commit is contained in:
20
lib/store.ts
Normal file
20
lib/store.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { configureStore } from "@reduxjs/toolkit";
|
||||
import authReducer from "./features/auth/authSlice";
|
||||
import usersReducer from "./features/users/usersSlice";
|
||||
import corsReducer from "./features/cors/corsSlice";
|
||||
|
||||
export const makeStore = () => {
|
||||
return configureStore({
|
||||
reducer: {
|
||||
auth: authReducer,
|
||||
users: usersReducer,
|
||||
cors: corsReducer,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// Infer the type of makeStore
|
||||
export type AppStore = ReturnType<typeof makeStore>;
|
||||
// Infer the `RootState` and `AppDispatch` types from the store itself
|
||||
export type RootState = ReturnType<AppStore["getState"]>;
|
||||
export type AppDispatch = AppStore["dispatch"];
|
||||
Reference in New Issue
Block a user