vuex-localstorage

:dvd: Persist Vuex state with expires by localStorage or some else storage.
10,447 125
Install
npm install vuex-localstorage
Latest Version:1.0.0
Vue:2
Older releases:1
License:MIT
Last Updated:Apr 13, 2017
Links: GitHub  ·  npm
Maintainer: imliwenfu

VUEX-LOCALSTORAGE

:dvd: Persist Vuex state with expires by localStorage or some else storage.

Travis Coveralls dependencies devDependency Status NPM version

Usage

import { Store } from 'vuex'
import createPersist, { createStorage } from 'vuex-localstorage'

new Store({
  plugins: [createPersist({
    namespace: 'namespace-for-state'
    initialState: {},
    // ONE_WEEK
    expires: 7 * 24 * 60 * 60 * 1e3
  })]
}

Live Example at PLATO

Development Setup

# install deps
npm install

# build dist files
npm run build

# lint & run all tests
npm test

# run unit tests only
npm run unit

Special Thanks

vuex-persistedstate

License

MIT

Related Packages

vuex-persist

A Vuex persistence plugin in Typescript

2,829,593 1,645
@nag5000/vuex-persist

A Vuex persistence plugin in Typescript

1,305 0
vuex-along

Automatically restore vuex state after refreshing the page

10,136 259
vuex-masked-modules

Plugin for working with Vuex. Allows to use localeStorage to store state. It is...

1,001 3
nuxt-vuex-localstorage

Nuxt.js localstorage with vuex store! and polyfill

101,432 159

Version History

Version Released Vue License
1.0.0 ^2.1.10 MIT
0.5.0 MIT
0.4.0 MIT
0.3.0 MIT
0.2.1 MIT