redux-persist icon indicating copy to clipboard operation
redux-persist copied to clipboard

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

Open jayoliveros286 opened this issue 2 years ago • 0 comments

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)

jayoliveros286 avatar Mar 16 '23 04:03 jayoliveros286