# @batou.dev/vuex-persist-plugin

> vuex-persist-plugin ===================

Latest version **0.1.0** (published 2021-07-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @batou.dev/vuex-persist-plugin
pnpm add @batou.dev/vuex-persist-plugin
yarn add @batou.dev/vuex-persist-plugin
bun add @batou.dev/vuex-persist-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-07-21 |
| First published | 2021-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vincent Batoufflet |
| Maintainers | vbatoufflet |

## Links

- npm: https://www.npmjs.com/package/@batou.dev/vuex-persist-plugin
- Repository: https://github.com/vbatoufflet/vuex-persist-plugin
- Homepage: https://github.com/vbatoufflet/vuex-persist-plugin#readme
- Issues: https://github.com/vbatoufflet/vuex-persist-plugin/issues
- npm.io page: https://npm.io/package/@batou.dev/vuex-persist-plugin

## Recent versions

- 0.1.0 (latest) — 2021-07-21

## README

vuex-persist-plugin
===================

[Vuex](https://vuex.vuejs.org/) plugin that provides state persistence relying
on a [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Storage)
object.

Install
-------

To get started using this plugin, add the dependency via npm:

```
npm install @batou.dev/vuex-persist-plugin
```

then use it as a Vuex plugin:

```typescript
import Persist from "@batou.dev/vuex-persist-plugin";

const persist = new Persist<State>({
    // Optional configuration properties (see below)
});

const store = createStore<State>({
    state: { … },
    mutations: { … },
    plugins: [persist.plugin()],
});
```

Configuration
-------------

| Property   | Type              | Default               | Description                                                         |
| ---------- | ----------------- | --------------------- | ------------------------------------------------------------------- |
| debounce   | number            | `250`                 | Debounce timeout duration                                           |
| key        | string            | `vuex-persist`        | Key to store the state into                                         |
| reduce     | (state) => object |                       | Function to reduce the state. By default, the entire state is saved |
| storage    | Storage           | `window.localStorage` | An object implementing the Web Storage API interface                |
| unloadSave | boolean           | `false`               | Whether or not to automatically save the state upon page unload     |

Links
-----

* [Changelog](https://github.com/vbatoufflet/vuex-persist-plugin/blob/master/CHANGELOG.md)
* [npm package](https://www.npmjs.com/package/@batou.dev/vuex-persist-plugin)

License
-------

This code is licensed and distributed under the term of the
[MIT](https://opensource.org/licenses/MIT) license.

---
_Source: https://npm.io/package/@batou.dev/vuex-persist-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
