超时后Redux-persist重置持久存储

时间:2019-07-03 13:32:34

标签: javascript reactjs redux redux-persist

我知道,向redux-persist添加了一种在超时后重置我的持久存储的功能:https://github.com/rt2zz/redux-persist/pull/713
不幸的是,我无法实现它...我应该在哪里添加此超时时间?

我尝试过这样的操作:

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

这是

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

什么都不起作用...

0 个答案:

没有答案