Weird / destructive behaviour using mapActions service find between components
See original GitHub issueI’m having a weird behaviour using find, this is how I’m using it:
I’m using feather-vuex 0.4.2, I also tried 0.3.1 and I get the same result.
First component
On the first component I do a find without a query, it returns all the results and store them on vuex.
methods: {
...mapActions('profiles', { findProfiles: 'find' }),
fetch() {
this.findProfiles({})
},
},
created() {
this.fetch()
},
Screenshot of Vuex state after find:
Second component
Now I do a get and after it the results fetched with the find are still in the store. Everything is fine here.
methods: {
...mapActions('profiles', { getProfile: 'get' }),
fetch() {
this.getProfile(this.user.profile)
},
},
created() {
this.fetch()
},
Third component
Now I do other find but with a custom query, I just want to find an element, the query works fine but it destroy the results of the first find 😦
methods: {
...mapActions('profiles', { findProfile: 'find' }),
fetch() {
this.findProfile({
query: { slug: this.$route.params.slug },
})
},
},
created() {
this.fetch()
},
Is this a bug or the expected behaviour? I’m missing something?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
created hooks fired before destroyed in hot reload · Issue #6518
The current vdom behavior creates new nodes before destroying old ones ... I select my component through the vue devtool and do $vm....
Read more >The Link Between Addiction & Self-Destructive Behavior
Self-destructive behavior & addiction go hand in hand, but there's more to the relationship. Learn more about the psychology of self-destructive behavior.
Read more >Actions | Vuex
Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call ...
Read more >Self Destructive Behavior: What It Is & Why We Do It - Healthline
Self-destructive behavior is when you do something that's sure to cause self-harm, whether it's emotional or physical. Some self-destructive ...
Read more >DHS Acronyms, Abbreviations, and Terms (DAAT) List
DHS Acronyms, Abbreviations, and Terms (DAAT) List ; DHS, Disaster Health Service. | FEMA | ; DHS, U.S. Department of Homeland Security. |...
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
Thanks for reporting back. It will take me some time to figure out a solution.
I tried again version 0.3.0 and 0.3.1 and now all the data persists 😄
Probably I didn’t removed correctly the 0.4.2.
I still have to learn how to use breakpoints…