我知道,向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);
什么都不起作用...