Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 454 Bytes

README.md

File metadata and controls

25 lines (19 loc) · 454 Bytes

redux-persist-transform-expire

Add expiration to your persisted store.

Usage

import createExpirationTransform from 'redux-persist-transform-expire';

const expireTransform = createExpirationTransform({
  'reducer0' :{
      expireSpan: 1000 * 5, // 5s
      default: {} // default data when expired
  },
  'reducer1' :{
      expireSpan: 1000 * 2,
      default: null
  }
});

persistStore(store, {
  transforms: [expireTransform]
});