# redux-persist2

> Persist and rehydrate a redux store.

Latest version **1.7.0** (published 2018-01-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install redux-persist2
pnpm add redux-persist2
yarn add redux-persist2
bun add redux-persist2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2018-01-11 |
| First published | 2017-10-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | guopingZhao |
| Maintainers | guopingzhao |

## Links

- npm: https://www.npmjs.com/package/redux-persist2
- Repository: https://github.com/guopingzhao/redux-persist
- Homepage: https://github.com/guopingzhao/redux-persist#readme
- Issues: https://github.com/guopingzhao/redux-persist/issues
- npm.io page: https://npm.io/package/redux-persist2

## Dependencies (1)

- [babel](https://npm.io/package/babel.md) ^6.23.0

## Recent versions

- 1.7.0 (latest) — 2018-01-11
- 1.6.9 — 2017-10-30
- 1.6.8 — 2017-10-30
- 1.2.8 — 2017-10-30
- 1.1.8 — 2017-10-30
- 1.1.7 — 2017-10-30
- 1.1.6 — 2017-10-30
- 1.1.5 — 2017-10-30
- 1.1.4 — 2017-10-30
- 1.1.3 — 2017-10-30
- 1.1.2 — 2017-10-30
- 1.1.1 — 2017-10-30
- 1.0.1 — 2017-10-12
- 1.0.0 — 2017-10-12

## README

# Redux Persist
Persist and rehydrate a redux store.

`npm i --save redux-persist2`


## Basic Usage
Basic usage requires adding a few lines to a traditional redux application:
```js
import {compose, applyMiddleware, createStore} from 'redux'
import persist from 'redux-persist2'

// add `persist` as an enhancer to your store
const store = createStore(
  reducer,
  ...
  compose(
    applyMiddleware(...),
    persist(options)
  )
)

```
## Options
```js
key?String: default value "REDUX"   保存的key
storage?Object: default value sessionStorage   保存的位置
reducer?Function: default value (state) => state  保存过滤
save?Function: default value (key, storage, state) => {storage.setItem(key, JSON.stringify(state))} 存储函数
ondispatch?Function: default undefined   dispatch时触发
```

---
_Source: https://npm.io/package/redux-persist2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
