rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.9k stars 862 forks source link

Nested Persists issue : https://github.com/rt2zz/redux-persist#nested-persists #1434

Open jayoliveros286 opened 1 year ago

jayoliveros286 commented 1 year ago

Example code, blacklisted the auth for rootPersistConfig , and for the authPersistConfig, not updating on storage from rootReducer, my goal here is auth from combineReducers will be stored on another storage but the state on storage is not updating, only rootReducer is updating

import { combineReducers } from 'redux' import { persistReducer } from 'redux-persist' import storage from 'redux-persist/lib/storage'

import { authReducer, otherReducer } from './reducers'

const rootPersistConfig = { key: 'root', storage: storage, blacklist: ['auth'] }

const authPersistConfig = { key: 'auth', storage: storage, blacklist: ['somethingTemporary'] }

const rootReducer = combineReducers({ auth: persistReducer(authPersistConfig, authReducer), other: otherReducer, })

export default persistReducer(rootPersistConfig, rootReducer)