Files
2025-02-06 20:33:26 +02:00

24 lines
819 B
TypeScript

import { configureStore } from "@reduxjs/toolkit";
import { drugSlice } from "./features/drug/drugSlice";
import createSagaMiddleware from "redux-saga";
import { rootSaga } from "@/middleware/rootSaga";
import { statusSlice } from "./features/status/statusSlice";
import { errorStatusSlice } from "./features/errorstatus/errorStatusSlice";
const sagaMiddleware = createSagaMiddleware();
export const store = configureStore({
reducer: { drug: drugSlice.reducer, status: statusSlice.reducer, errorStatus: errorStatusSlice.reducer },
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat([sagaMiddleware])
});
sagaMiddleware.run(rootSaga);
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export type AppStore = typeof store;