1.0.0 β€’ Published 4 years ago

vuex-state-storage-sync v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Vuex State and Storage(local, session) Synchronization module

πŸ•ΉGuide

Install

$ npm install --save vuex-state-storage-sync

Usage

import Vue from 'vue';
import Vuex from 'vuex';
import syncStateStorage from 'vuex-state-storage-sync';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // ...
  },
  getters: {
    // ...
  },
  mutations: {
    // ...
  },
  actions: {
    // ...
  },
  modules: {
    // ...
  }
  plugins: [
    syncStateStorage({
      storage: window.localStorage || window.sessionStorage, // Storage Types
      key: '',  // Storage Key Name
      path: [''] // State data to be synchronized to storage
    })
  ]
});

πŸ“¬ Recommended Commit Message

WhenCommit Message
Add functionfeat: ⚑️ Add function
Fix bugfix: 🐞 Fix bug
Refactoringrefactor: πŸ›  Refactoring
Add packagepackage: πŸ“¦ Add package
Fix readmedocs: πŸ“š Fix readme
Improvements stylestyle: πŸ‘ Improvements style

πŸ’³ License

MIT