implement redux toolkit for manage globle state

This commit is contained in:
Jaanu423
2025-09-16 18:30:30 +05:30
parent 6ed8163d25
commit a931f886b2
7 changed files with 317 additions and 160 deletions
+13
View File
@@ -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;