import { Action, configureStore, ThunkAction } from "@reduxjs/toolkit"; import authReducer from "features/auth/authSlice"; import appErrorReducer from "features/error/appErrorSlice"; import localeReducer from "features/locale/localeSlice"; import orderSlice from "features/order/orderSlice"; import themeReducer from "features/theme/themeSlice"; import { baseApi } from "./api/apiSlice"; export const store = configureStore({ reducer: { auth: authReducer, theme: themeReducer, locale: localeReducer, appError: appErrorReducer, order: orderSlice, [baseApi.reducerPath]: baseApi.reducer, }, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }).concat( baseApi.middleware ), }); export type RootState = ReturnType; export type AppDispatch = typeof store.dispatch; export type AppThunk = ThunkAction< ReturnType, RootState, unknown, Action >;