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.
Effectively vuex-persistedstate modify's the store state within it's constructor and doesn't emit any mutations to the store thereby breaking the initial state.
As far as I can tell, the plugin will need a significant re-write to support this.
The text was updated successfully, but these errors were encountered:
@jaitaiwan thanks for notifying about this. I don't see any "official" guidelines, so could you maybe give a summary on how the plugin needs to be rewritten?
According to https://vuex.vuejs.org/guide/plugins.html#committing-mutations-inside-plugins plugins should not directly mutate state at all but rather should rely on mutations. From what I could tell of the plugin it's missing any concept of a mutation and emitting changes to the store (I did find it difficult to tell what branches have active development, but after checking 3 of them that was my conclusion).
I've just opened up a new PR to vuex-persist to fix some of their issue with vuex 4; but theirs is because of the use of Vue.set. They already have documentation around enabling "strict mode" and adding a mutation from the plugin.
Does that help at all? I haven't had much more time to delve into vuex-persistedstate beyond my initial comments above and in the vuex ticket.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
vuex-persistedstate
version: 4.1.0node
version: 16.9.1npm
(oryarn
) version: 3.0.2Refer to vuejs/vuex#2046 (comment)
Effectively vuex-persistedstate modify's the store state within it's constructor and doesn't emit any mutations to the store thereby breaking the initial state.
As far as I can tell, the plugin will need a significant re-write to support this.
The text was updated successfully, but these errors were encountered: