16 lines
502 B
TypeScript
16 lines
502 B
TypeScript
import { configureStore } from "@reduxjs/toolkit";
|
|
import "@/lib/features/bookSlice";
|
|
import bookReducer from "./features/bookSlice";
|
|
|
|
export const makeStore = () => {
|
|
return configureStore({
|
|
reducer: { books: bookReducer },
|
|
});
|
|
};
|
|
|
|
// 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"];
|