vue-electron / vuex-electron

Integration of Vuex and Electron
MIT License
305 stars 97 forks source link

persist only selected paths #18

Open achtan opened 5 years ago

achtan commented 5 years ago

can please you implement:

paths <Array>: An array of any paths to partially persist the state. If no paths are given, the complete state is persisted. (default: [])

from https://github.com/robinvdvleuten/vuex-persistedstate

Stormtv commented 5 years ago

The whitelist and blacklist options should allow you to mirror this functionality if I am not mistaken.

createPersistedState({
  blacklist: ['Onboarding/setSeed']
})
achtan commented 5 years ago

currently i have 11 store modules with avg 6 actions... so its 66 actions and still growing :) ... so maintain so many actions in whitelist array is a byt difficult with 'paths' support i can only specify modules, and thats it :)

createPersistedState({
  paths: ['System','CN', 'DB', 'CL', 'DocumentsTree', 'Columns', 'DocumentActions', 'QuickSearches', 'QueryHistory', 'QueryFavorites', 'Settings', 'Tabs']
})
Stormtv commented 5 years ago

Good points. I'll look into it it might clean my code up a little bit also.

akodkod commented 5 years ago

@achtan, unfortunately, I don't have enough time to implement it by myself at the moment. But, please, feel free to open a pull-request with such functionality, I would be happy to merge it.

The best place to start: https://github.com/vue-electron/vuex-electron/blob/master/src/persisted-state.js#L91

Thank you!

zciendor commented 5 years ago

The whitelist and blacklist options should allow you to mirror this functionality if I am not mistaken.

No it doesn't seem to work that way. See issue #19 for details.

akodkod commented 5 years ago

https://github.com/vue-electron/vuex-electron/issues/44