redux-persist-except-ings
v0.0.2
Published
Ignore event states that contains "ing", avoids stalemate occured by app restarting during events
Downloads
3
Readme
Redux Persist - Except "ing"s
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] });