vuex-localstorage
v1.0.0
Published
:dvd: Persist Vuex state with expires by localStorage or some else storage.
Downloads
913
Maintainers
Readme
VUEX-LOCALSTORAGE
:dvd: Persist Vuex state with expires by localStorage or some else storage.
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
})]
}
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