1.1.6 • Published 5 years ago
vuex-storage-sync v1.1.6
vuex-storage-sync
Vuex plugin for sync state between browser tabs
Installation
$ npm install vuex-storage-sync
Usage
import Vue from 'vue'
import Vuex from 'vuex'
import createStorageSync from 'vuex-storage-sync'
Vue.use(Vuex)
export function createStore () {
return new Vuex.Store({
actions: {},
getters: {},
mutations: {},
state: {},
plugins: [
createStorageSync(),
// or with params
createStorageSync({
// Allowed to snapshoting modules
modules: [],
// Allowed to synchronize mutations
mutations: [],
mutationKey: 'MY_MUTATION_KEY',
snapshotKey: 'MY_SNAPSHOT_KEY'
})
]
})
}
License
MIT © Eduard Nikolenko