Skip to content

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

Notifications You must be signed in to change notification settings

chenjietao/vuex-electron-sync-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published