Files
next-go-blog/lib/store.ts
Beyhan Oğur 6d95e27114 first commit
2026-04-26 22:16:43 +03:00

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"];