import { configureStore } from "@reduxjs/toolkit"; import { setupListeners } from "@reduxjs/toolkit/dist/query"; import restApi from "./restapi"; import webApi from "./webapi"; export const rootReducer = { [webApi.reducerPath]: webApi.reducer, [restApi.reducerPath]: restApi.reducer, } export const store = configureStore({ reducer: rootReducer, middleware: (getDefaultMiddle)=> getDefaultMiddle({ serializableCheck: false, }) .concat(webApi.middleware) .concat(restApi.middleware), devTools: process.env.NODE_ENV === 'development' }); export type RootState = ReturnType<typeof store.getState>; export type AppDispatch = typeof store.dispatch; setupListeners(store.dispatch);