0.0.2 • Published 8 years ago

redux-persist-except-ings v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Redux Persist - Except "ing"s npm version

Ignore event states that contains "ing", avoids stalemate occured by app restarting during events (something like { profileRefreshing: true }).

Using this transform will prevent persisting (neither save or restore) all states with the ing keyword in it's name.

For example,

{
  profile: {
    name: "Pokai Chang",
    updatedAt: "2015-12-19T16:20:40.575Z",
    updating: true
  }
}

will become:

{
  profile: {
    name: "Pokai Chang",
    updatedAt: "2015-12-19T16:20:40.575Z"
  }
}

Install

npm install redux-persist-except-ings --save

Usage

import { compose } from 'redux';
import { persistStore, autoRehydrate } from 'redux-persist';
import reduxPersistExpectIngs from 'redux-persist-except-ings';

const reducer = combineReducers(reducers);
const store = compose(autoRehydrate(), createStore)(reducer);

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