smart-localstorage
v1.0.4
Published
egraded compatibility encapsulation of vuex-persistedstate
Downloads
3
Readme
Simply do a degraded compatibility encapsulation of vuex-persistedstate
Usage:
npm install smart-localstorage (or yarn add)
...
import Vuex from 'vuex'
import smartLocalstorage from 'smart-localstorage'
...
export default new Vuex.Store({
...
/* localStorage || sessionStorage || */
plugins: [smartLocalstorage()]
})
package use localstorage by default, use sessionStorage by transfer parameter 'sessionStorage' like smartLocalstorage('sessionStorage'), the downgrade process is using js-cookie