vuex-electron-sync-state

1.0.1 • Public • Published

vuex-electron-sync-state

Vuex plugin for synchronizing the vuex state in each electron process.

Usage

// src/renderer/store/index.js
import Vuex from 'vuex'
import syncStatePlugin from 'vuex-electron-sync-state'
 
const store = Vuex.Store({})
 
export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  plugins: [
    syncStatePlugin
  ]
})

And you should import the store entry in main process.

// src/main/main.js
import store from '../renderer/store/index'
 
...

Notice

The actions logic will be executed in the dispatched process. The mutations logic will be executed in all process.

So you need to pay attention to which process the code logic will be executed in.

Package Sidebar

Install

npm i vuex-electron-sync-state

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

5.84 kB

Total Files

6

Last publish

Collaborators

  • chenjietao