# redux-stash-async-storage

> Persist and rehydrate parts or all of your Redux store.

Latest version **1.2.0** (published 2020-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-stash-async-storage
pnpm add redux-stash-async-storage
yarn add redux-stash-async-storage
bun add redux-stash-async-storage
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-12-19 |
| First published | 2018-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jacob Buck |
| Maintainers | jacobbuck |
| Keywords | redux-stash, redux-stash-storage, react-native, async-storage |

## Links

- npm: https://www.npmjs.com/package/redux-stash-async-storage
- Repository: https://github.com/jacobbuck/redux-stash
- Homepage: https://github.com/jacobbuck/redux-stash#readme
- Issues: https://github.com/jacobbuck/redux-stash/issues
- npm.io page: https://npm.io/package/redux-stash-async-storage

## Dependencies (2)

- [redux-stash](https://npm.io/package/redux-stash.md) ^1.2.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.12.5

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2020-12-19
- 1.1.0 — 2020-07-24
- 1.0.1 — 2020-07-24
- 1.0.0 — 2020-07-10
- 0.2.0 — 2020-03-08
- 0.1.3 — 2019-06-02
- 0.1.2 — 2019-02-24
- 0.1.1 — 2018-09-26
- 0.1.0 — 2018-09-25

## README

# redux-stash

Persist and rehydrate parts or all of your Redux store.

## Getting started

Install with your favourite package manager:

```sh
npm install --save redux-stash
```

## Usage

```js
import { applyMiddleware, createStore } from 'redux';
import {
  REHYDRATE,
  createStash,
  createStashMiddleware,
  rehydrateStore,
  LocalStorage,
} from 'redux-stash';

const reducer = (state = { foo: '' }, action) => {
  switch (action.type) {
    case REHYDRATE:
      return {
        ...state,
        foo: action.payload.foo
      };
    default:
      return state;
  }
};

const stashMiddleware = createStashMiddleware(
  createStash({
    name: 'foo',
    selector: state => state.foo,
    storage: new LocalStorage('foo'),
  });
);

const store = createStore(rootReducer, applyMiddleware(stashMiddleware));

rehydrateStore(store);
```

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