redux-persist-transform-expire

Add expiration to your persisted store

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
redux-persist-transform-expire
0.0.27 years ago8 years agoMinified + gzip package size for redux-persist-transform-expire in KB

Readme

redux-persist-transform-expire
npm
Add expiration to your persisted store.

Usage

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

const expireTransform = createExpirationTransform({
  expireKey: 'customExpiresAt',
  defaultState: {
    custom: 'values'
  }
});

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

Configuration

| Attr | Type | Default | Notes | | ------------ | ------ | ------------------ | --------------------------------------------------- | | expireKey | String | 'persistExpiresAt' | Name of the attribute holding the expire date value | | defaultState | Any | {} | Shape of the state after expirations happen |