vuex-electron icon indicating copy to clipboard operation
vuex-electron copied to clipboard

persist only selected paths

Open achtan opened this issue 5 years ago • 6 comments

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

achtan avatar Jan 02 '19 15:01 achtan

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

createPersistedState({
  blacklist: ['Onboarding/setSeed']
})

Stormtv avatar Jan 11 '19 21:01 Stormtv

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']
})

achtan avatar Jan 12 '19 21:01 achtan

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

Stormtv avatar Jan 16 '19 16:01 Stormtv

@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!

akodkod avatar Jan 19 '19 20:01 akodkod

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.

zciendor avatar Jan 20 '19 18:01 zciendor

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

akodkod avatar Aug 29 '19 14:08 akodkod