You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this functionality, is working great.
I was wondering: you now have to set an expire date on each reducer separately. In my use case, I just have to expire all the persisted data, regardless of which reducer it's part of. Is there a way of doing that?
The text was updated successfully, but these errors were encountered:
Hi! Sorry for the super late response to this but better late than never I hope. See code below on what I use to purge a reducer completely. The imported reducerVersion is just a static variable that can be increased on new builds
importReduxPersistfrom'../config/ReduxPersist';import{AsyncStorage}from'react-native';import{persistStore}from'redux-persist';import{startupasstartupAction}from'../modules/Startup';constupdateReducers=(store: Object)=>{constreducerVersion=ReduxPersist.reducerVersion;constconfig=ReduxPersist.storeConfig;conststartup=()=>store.dispatch(startupAction());// Check to ensure latest reducer versionAsyncStorage.getItem('reducerVersion').then((localVersion)=>{if(localVersion!==reducerVersion){// Purge storepersistStore(store,config,startup).purge();AsyncStorage.setItem('reducerVersion',reducerVersion);}else{persistStore(store,config,startup);}}).catch(()=>{persistStore(store,config,startup);AsyncStorage.setItem('reducerVersion',reducerVersion);});};exportdefault{updateReducers};
Thank you for this functionality, is working great.
I was wondering: you now have to set an expire date on each reducer separately. In my use case, I just have to expire all the persisted data, regardless of which reducer it's part of. Is there a way of doing that?
The text was updated successfully, but these errors were encountered: