Files
Adv-WebDev-W4-part1/lib/store.ts
T
2026-10-04 14:02:29 +01:00

16 lines
525 B
TypeScript

import { configureStore } from "@reduxjs/toolkit";
import "@/lib/features/people/personSlice";
import personReducer from "./features/people/personSlice";
export const makeStore = () => {
return configureStore({
reducer: { people: personReducer },
});
};
// 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"];