smart-localstorage

egraded compatibility encapsulation of vuex-persistedstate

Usage no npm install needed!

<script type="module">
  import smartLocalstorage from 'https://cdn.skypack.dev/smart-localstorage';
</script>

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