question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird / destructive behaviour using mapActions service find between components

See original GitHub issue

I’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: screen shot 2017-06-09 at 10 40 13

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()
},
screen shot 2017-06-09 at 11 06 24

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()
},
screen shot 2017-06-09 at 11 10 29

Is this a bug or the expected behaviour? I’m missing something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marshallswaincommented, Jun 19, 2017

Thanks for reporting back. It will take me some time to figure out a solution.

1reaction
dortamiguelcommented, Jun 19, 2017

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found