Redux-persist reset persisted store after timeout

自闭症网瘾萝莉.ら 提交于 2019-12-13 03:32:30

问题


I know, that to redux-persist was added an ability to reset my persisted store after some timeout: https://github.com/rt2zz/redux-persist/pull/713
Unfortunately, I can"t implement it... Where I should add this timeout?

I have tried smth like this:

const persistor = persistStore(store, { timeout: 10000 }, () => {
  persistor.purge();
});

And this:

const persistConfig = {
  key: 'order',
  storage: localStorage,
  timeout: 6000, ///!!!
  whitelist: ['orderReducer'],
  blackList: ['advantagesReducer']
};
const persistedReducer = persistReducer(persistConfig, rootReducer);

Nothing works...

来源:https://stackoverflow.com/questions/56871364/redux-persist-reset-persisted-store-after-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!