redux-persist

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'] };

IndexedDB size keeps growing even though data saved doesn't change

我是研究僧i 提交于 2019-12-04 23:48:17
问题 I am using Redux Persist and LocalForage in my web application. I have a series of actions that are fired upon login that update some data about the user. The IndexedDB size after all actions are fired and the data is saved in the JSON format on indexedDB is ~1.4Mb. However if I refresh the page thus triggering again the actions, or if log out and back in, even though the values inside IndexedDB DO NOT change (I have double checked with a JSON diff tool), the size of the storage keeps on

Why use redux-persist over manually persisting state to localStorage?

。_饼干妹妹 提交于 2019-12-04 23:47:15
问题 Another way to ask would be, if you really only want to start your app up with the data saved in localStorage (rehydrate) and save every redux state change to localStorage (persist) is using redux-persist any better to using your own solution like Dan Abramov explains here ? I understand redux-persist comes with a lot of other features, and I myself started using it to be able to use redux-persist-crosstab (to be able to deal with changes between apps running in different tabs), but I wonder

Why use redux-persist over manually persisting state to localStorage?

夙愿已清 提交于 2019-12-03 16:10:14
Another way to ask would be, if you really only want to start your app up with the data saved in localStorage (rehydrate) and save every redux state change to localStorage (persist) is using redux-persist any better to using your own solution like Dan Abramov explains here ? I understand redux-persist comes with a lot of other features, and I myself started using it to be able to use redux-persist-crosstab (to be able to deal with changes between apps running in different tabs), but I wonder if it's overkill to use it for the most basic scenario. Especially since it's harder to understand and