21 lines
673 B
TypeScript
21 lines
673 B
TypeScript
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"];
|