implement redux toolkit for manage globle state
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// store.ts
|
||||
import { configureStore } from "@reduxjs/toolkit";
|
||||
import userReducer from "./userSlice"; // adjust the path
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
user: userReducer, // register user slice here
|
||||
},
|
||||
});
|
||||
|
||||
// ✅ Types for TypeScript
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
export type AppDispatch = typeof store.dispatch;
|
||||
Reference in New Issue
Block a user