$reset for composition API stores #2543
Unanswered
JollyBrackets
asked this question in
Help and Questions
Replies: 1 comment 2 replies
-
Depending on what's on the state (Classes, Dates, circular references) and the method used for cloning, this method might not always work. Calling the function
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In reference to #1012, the $reset method is not available on stores using the composition API.
This solution on Stack overflow proposes an elegant way on how to do this using a plugin:
https://stackoverflow.com/questions/71690883/pinia-reset-alternative-when-using-setup-syntax
We have build something similar as a Nuxt plugin:
Is there a reason why we should not use this?
If not, would this be a good addition to Pinia itself?
Beta Was this translation helpful? Give feedback.
All reactions