# @naturalcycles/vue-lib

> Useful functions for Vue.js

Latest version **1.1.0** (published 2021-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @naturalcycles/vue-lib
pnpm add @naturalcycles/vue-lib
yarn add @naturalcycles/vue-lib
bun add @naturalcycles/vue-lib
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-03-15 |
| First published | 2021-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12.13.1 |
| Dependencies | 1 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Natural Cycles Team |
| Maintainers | kirillgroshkov, cervicalmucus, kribor |

## Links

- npm: https://www.npmjs.com/package/@naturalcycles/vue-lib
- Repository: https://github.com/NaturalCycles/vue-lib
- Homepage: https://github.com/NaturalCycles/vue-lib#readme
- Issues: https://github.com/NaturalCycles/vue-lib/issues
- npm.io page: https://npm.io/package/@naturalcycles/vue-lib

## Dependencies (1)

- [@naturalcycles/js-lib](https://npm.io/package/@naturalcycles/js-lib.md) ^14.15.0

## Recent versions

- 1.1.0 (latest) — 2021-03-15
- 1.0.0 — 2021-03-07

## README

## @naturalcycles/vue-lib

> Useful functions for Vue.js 2.x

[![npm](https://img.shields.io/npm/v/@naturalcycles/vue-lib/latest.svg)](https://www.npmjs.com/package/@naturalcycles/vue-lib)
[![min.gz size](https://badgen.net/bundlephobia/minzip/@naturalcycles/vue-lib)](https://bundlephobia.com/result?p=@naturalcycles/vue-lib)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

# Features

## createLocalStoragePlugin

LocalStorage persistence plugin for [Vuex](https://github.com/vuejs/vuex) 3.x (compatible with Vue
2.x).

Works in Nuxt (!).

```ts
interface GlobalState {
  count: number
}

const emptyState: GlobalState = {
  count: 0,
}

export const localStoragePlugin = createLocalStoragePlugin<GlobalState>({
  emptyState,
})

export const store = new Vuex.Store<GlobalState>({
  mutations: {},
  plugins: [localStoragePlugin],
})
```

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