Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
Can you persist individual states in redux persist

So I am using redux toolkit and redux persist to persist certain reducers but the problem is I don't want to persist the entire reducer but instead just the states inside of the reducer

the code where im whitlisting(persisting} certain reducers

src/app/store.js

import { combineReducers, configureStore } from "@reduxjs/toolkit";
import { persistReducer } from "redux-persist";
import storageSession from "redux-persist/es/storage/session";
import thunk from "redux-thunk";

import registerReducer from "../features/register.slice";
import verificationReducer from "../features/verification.slice";

// Combining reducers
const reducers = combineReducers({
  register: registerReducer,
  verification: verificationReducer,
});

const persistConfig = {
  key: "root",
  storage: storageSession,
  whitelist: ["verification"], // Slicers that will be persisted
};

const persistedReducer = persistReducer(persistConfig, reducers);

// Creating store
export const store = configureStore({
  reducer: persistedReducer,
  devTools: process.env.NODE_ENV !== "production",
  middleware: [thunk],
});

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda