-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
The whole global state is persisted in the Store: https://github.com/vue-electron/vuex-electron/blob/master/src/persisted-state.js#L96
It would be nice to be able to only save parts of the state. We can easily imagine that some part of the state are transient (only relevant to the current execution of the application) and shouldn't not be persisted on disk (and not reloaded at startup).
On top of my mind changing setState
like this could be sufficient:
setState(state) {
const stateToPersist = typeof this.options.statePick === 'function' ? this.options.statePick(state) : state
this.options.storage.set(this.options.storageKey, stateToPersist)
}
And because the loading operation do a deep merge with the initial state it should work seamlessly. Thoughts?
Metadata
Metadata
Assignees
Labels
No labels