1.0.4 • Published 6 years ago
smart-localstorage v1.0.4
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