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; // Infer the `RootState` and `AppDispatch` types from the store itself export type RootState = ReturnType; export type AppDispatch = AppStore["dispatch"];