import { configureStore , getDefaultMiddleware } from '@reduxjs/toolkit' ; import { persistStore , FLUSH , REHYDRATE , PAUSE , PERSIST , PURGE , REGISTER } from 'redux-persist' ; import createSagaMiddleware from 'redux-saga' ; import { persistedRootReducer } from '@redux/reducers' ; import rootSaga from '@redux/rootSaga' ; const sagaMiddleware = createSagaMiddleware ( ) ; const middleware = [ ... getDefaultMiddleware ( { thunk : false , serializableCheck : { ignoredActions : [ FLUSH , REHYDRATE , PAUSE , PERSIST , PURGE , REGISTER ] , } , } ) , sagaMiddleware , ] ; const store = configureStore ( { reducer : persistedRootReducer , middleware , devTools : process . env . NODE_ENV !== 'production' , } ) ; sagaMiddleware . run ( rootSaga ) ; const persistor = persistStore ( store , null ) ; export { store , persistor } ;