Vuex Electron
The easiest way to share your Vuex Store between all processes (including main).
Features
⭐️ Persisted state
⭐️ Shared mutations
Requirements
Installation
Installation of the Vuex Electron easy as 1-2-3.
-
Install package with using of yarn or npm:
yarn install vuex-electron
or
npm install vuex-electron
-
Include plugins in your Vuex store::
VueVuex -
In case if you enabled
createSharedMutations()
plugin you need to create an instance of store in the main process. To do it just add this line into your main process (for examplesrc/main.js
): -
Well done you did it! The last step is to add the star to this repo 😄
Usage example: Vuex Electron Example
IMPORTANT
In renderer process to call actions you need to use dispatch
or mapActions
. Don't use commit
because actions fired via commit
will not be shared between processes.
Options
Available options for createPersistedState()
Author
Andrew Emelianenko
IG: @truemelianenko