redux-persist-expire-state
Installation
yarn add redux-persist-expire-state
or
npm install redux-persist-expire-state
Usage
;; const config = expireAfter: 10 * 60 * 60 // Expiration time of 10 hours, defaults to null expireKey: 'persistedAt' // key to be used in the state, defaults to persistedTimestamp expireState: error: null data: // state to be used after persisted state expires, defaults to {}; const persistedReducer = ; const store = ;const persistedStore = ;
Examples
// Reset `user` to empty object if not updated for 30 mins