You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
I register a dynamic module with this command. When preserveState is false, the state is overwritten by the default store values (this is okay). When preserveState is true, the state is overwritten by the state persisted in the localStore. Since I use paths, the state is not complete; some keys in the state are now undefined.
My options when declaring createPersistedState says explicitly overwrite: false, so based on my understanding, it should deepMerge the localStore with the currently active state (which is the default values when registering the module) : but it doesn't.
Vue crashes because some keys are undefined. I had to create a new init() mutation to fix the store after the module creation:
@mutationinit(){if(!this.searchForm)this.searchForm=newSearchForm();// This property is persistedthis.loading=false;this.lines=[];}
Suggested solution: Perform a deepMerge instead of an overwrite when registering new modules dynamically with preserveState: true and overwrite: false
The text was updated successfully, but these errors were encountered:
vuex-persistedstate
version: 3.1.0node
version: 12.18.1npm
version: 6.14.5I register a dynamic module with this command. When preserveState is false, the state is overwritten by the default store values (this is okay). When preserveState is true, the state is overwritten by the state persisted in the localStore. Since I use paths, the state is not complete; some keys in the state are now undefined.
My options when declaring
createPersistedState
says explicitlyoverwrite: false
, so based on my understanding, it should deepMerge the localStore with the currently active state (which is the default values when registering the module) : but it doesn't.Vue crashes because some keys are undefined. I had to create a new
init()
mutation to fix the store after the module creation:Suggested solution: Perform a deepMerge instead of an overwrite when registering new modules dynamically with
preserveState: true
andoverwrite: false
The text was updated successfully, but these errors were encountered: