text: import {
    configureStore,
    combineReducers,
    getDefaultMiddleware,
  } from '@reduxjs/toolkit';
  import {
    persistStore,
    persistReducer,
    FLUSH,
    REHYDRATE,
    PAUSE,
    PERSIST,
    PURGE,
    REGISTER,
  } from 'redux-persist';
  import storage from 'redux-persist/lib/storage';
  
  import contactsReducer from './items/reducer';
  import userReduser from './auth/reducers';
  import errorReducer from './error/reducer';
  
  const userPersistConfig = {
    key: 'user',
    storage,
    whitelist: ['token'],
  };
  
  const rootReducer = combineReducers({
    contacts: contactsReducer,
    user: persistReducer(userPersistConfig, userReduser),
    error: errorReducer,
  });
  
  export const store = configureStore({
    reducer: rootReducer,
    middleware: getDefaultMiddleware =>
      getDefaultMiddleware({
        serializableCheck: {
          ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
        },
      }),
  });
  export const persistor = persistStore(store);
  