https://github.com/zetavg/redux-persist-except-ings
Ignore event states that contains "ing", avoids stalemate occured by app restarting during events.
https://github.com/zetavg/redux-persist-except-ings
Last synced: 2 months ago
JSON representation
Ignore event states that contains "ing", avoids stalemate occured by app restarting during events.
- Host: GitHub
- URL: https://github.com/zetavg/redux-persist-except-ings
- Owner: zetavg
- Created: 2015-12-19T16:11:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-19T16:23:12.000Z (over 9 years ago)
- Last Synced: 2025-04-01T22:59:55.272Z (2 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redux Persist - Except "ing"s [](https://www.npmjs.com/package/redux-persist-except-ings)
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,
```js
{
profile: {
name: "Pokai Chang",
updatedAt: "2015-12-19T16:20:40.575Z",
updating: true
}
}
```will become:
```js
{
profile: {
name: "Pokai Chang",
updatedAt: "2015-12-19T16:20:40.575Z"
}
}
```## Install
```bash
npm install redux-persist-except-ings --save
```## Usage
```js
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] });
```