# vue-data-stash

> Save the component data for rainy day

Latest version **0.1.2** (published 2018-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-data-stash
pnpm add vue-data-stash
yarn add vue-data-stash
bun add vue-data-stash
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-02-18 |
| First published | 2018-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kelin2025 |
| Maintainers | kelin2025 |

## Links

- npm: https://www.npmjs.com/package/vue-data-stash
- Repository: git@github.com:Kelin2025/vue-data-stash
- npm.io page: https://npm.io/package/vue-data-stash

## Recent versions

- 0.1.2 (latest) — 2018-02-18
- 0.1.1 — 2018-02-18
- 0.1.0 — 2018-02-17

## README

# vue-data-stash

Save component data for rainy day

## What?

This small mixin allows you to define _stashable_ data in your components i.e. data that will be saved until next time when component will be used.

## Why?

I'm bored to write `localStorage.setItem` for every time I need to save some data.

## Install

Install via NPM:

```
npm install vue-data-stash
```

Add it globally:

```javascript
import VueDataStash from 'vue-data-stash'

Vue.use(VueDataStash)
```

Or in a single component:

```javascript
import { mixin } from 'vue-data-stash'

export default {
  mixins: [mixin]
}
```

## Usage

Just add `stash` property like it's just `data`:

```javascript
export default {
  name: 'MyComponent',
  stash: () => ({
    activeId: true
  })
}
```

> **NOTE**: Name for localStorage is based on the `name` option

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