Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Reactivity lost #546

Open
BonBonSlick opened this issue Oct 23, 2021 · 0 comments
Open

Reactivity lost #546

BonBonSlick opened this issue Oct 23, 2021 · 0 comments

Comments

@BonBonSlick
Copy link

BonBonSlick commented Oct 23, 2021

SO issue description
https://stackoverflow.com/questions/42295340/how-to-clear-state-in-vuex-store

Update after using the below solution a bit more
So it turns out that if you use replaceState with an empty object ({}) you end up bricking reactivity since your state props go away. So in essence you have to actually reset every property in state and then use store.replaceState(resetStateObject). For store without modules you'd essentially do something like:

....

So state, getters show old values even though store was reset

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant