Can't reset store state / patch with pinia@2.0.0-rc.0
See original GitHub issueFirst of all thank you for your amazing work, I’m really excited to try all the new features coming into Pinia.
Reproduction
I tried the new version of pinia and it seems the store.$reset()
is no longer working or the api changed.
I created a repro with the issue: https://github.com/slauzinho/pinia-example-reset
Steps to reproduce the behavior
- Call
store.$reset
- State remains the same
Expected behavior
State should be the same as the initial
Actual behavior
State doesn’t change
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Can't reset store state / patch with pinia@2.0.0-rc.0 · Issue #593
Reproduction. I tried the new version of pinia and it seems the store.$reset() is no longer working or the api changed.
Read more >Pinia: How to reset stores created with function/setup syntax
Learn how to reset stores made with function syntax by creating a Pinia plugin. ... Pinia is a state management solution for Vue...
Read more >How to reset the state of a Redux store? - Stack Overflow
One way to do that would be to write a root reducer in your application. The root reducer would normally delegate handling the...
Read more >Can't reset store state / patch with pinia@2.0.0-rc.0
I tried the new version of pinia and it seems the store.$reset() is no longer working or the api changed. I created a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved it by replacing the state definition from
to
@Blackfaded I have this:
and
And still get state preserved across tests