text: import { configureStore } from '@reduxjs/toolkit';
  import {
    persistStore,
    persistReducer,
    FLUSH,
    REHYDRATE,
    PAUSE,
    PERSIST,
    PURGE,
    REGISTER,
  } from 'redux-persist';
  import storage from 'redux-persist/lib/storage';
  import { rootReducer } from 'redux/contacts/contacts-reducers';
  import authReducer from 'redux/auth/auth-slice';
  
  const authPersistConfig = {
    key: 'auth',
    storage,
    whitelist: ['token'],
  };
  
  export const store = configureStore({
    reducer: {
      auth: persistReducer(authPersistConfig, authReducer),
      phonebook: rootReducer,
    },
    devTools: process.env.NODE_ENV === 'development',
    middleware: getDefaultMiddleware =>
      getDefaultMiddleware({
        serializableCheck: {
          ignoredActions: [
            FLUSH,
            REHYDRATE,
            PAUSE,
            PERSIST,
            PURGE,
            REGISTER,
            'auth/login/rejected',
            'auth/register/rejected',
          ],
        },
      }),
  });
  
  export let persistor = persistStore(store);
  