Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tkgoya/vuex-electron

 
 

Repository files navigation

Vuex Electron

Travis Code Climate Code Climate Code Style Prettier Made With Love

The easiest way to use 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.

  1. Install package with using of yarn or npm:

    yarn install vuex-electron
    

    or

    npm install vuex-electron
    
  2. Include plugins in your Vuex store::

    import Vue from "vue"
    import Vuex from "vuex"
    
    import { createPersistedState, createSharedMutations } from "vuex-electron"
    
    Vue.use(Vuex)
    
    export default new Vuex.Store({
      // ...
      plugins: [
        createPersistedState(),
        createSharedMutations()
      ],
      // ...
    })
  3. Well done you did it! The last step is to add the star to this repo 😄

IMPORTANT

For proper work of the package, you shouldn't use store.commit outside of actions.

Options

Available options for createPersistedState()

createPersistedState({
  whitelist: ["whitelistedAction", "anotherWhitelistedAction"],

  // or

  whitelist: (mutation) => {
    return true
  },

  // or

  blacklist: ["ignoredAction", "anotherIgnoredAction"],

  // or

  blacklist: (mutation) => {
    return true
  }
})

Development Roadmap

  • Configure ESLint and Prettier
  • Configure Travis CI and CodeClimate
  • Minify package
  • Write tests
  • Write docs

About

Integration of Vuex and Electron

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%