You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello :)
I encountered a problem with MutationActions, when closing/switching the component, from which the action was triggered, before the action fully resolved.
Then any functions still running on the original componenwill not get the data commited by the MutationAction, when accessing the store.
Example:
From my starting component, I use the mutationAction fetchResults to fetch 2 results.
Before the results are received, I switch to a different component, because I get bored waiting for the results to arrive and just click around.
The component from which the MutationAction was triggered is still expecting to receive the results and to run some result processing (for visualization) in the background.
Problem: When this component access the store to read the results - the result variables are still empty.
ONLY HAPPENS IF switched to another component before the mutationAction is finished.
COMPONENT
// fetch result and create new result layers
this.$store
.dispatch("abm/fetchResults")
// sucessfully got result
.then(() => {
// this.result accesses a getter on the store variable
console.log(this.result) // prints NULL
debugger; // ----> this.result in the console prints NULL; using console to access the exact same store getter as this.result -> prints the expected result
STORE
I am using the exact example provided in the ReadMe:
Hello :)
I encountered a problem with MutationActions, when closing/switching the component, from which the action was triggered, before the action fully resolved.
Then any functions still running on the original componenwill not get the data commited by the MutationAction, when accessing the store.
Example:
From my starting component, I use the mutationAction fetchResults to fetch 2 results.
Before the results are received, I switch to a different component, because I get bored waiting for the results to arrive and just click around.
The component from which the MutationAction was triggered is still expecting to receive the results and to run some result processing (for visualization) in the background.
Problem: When this component access the store to read the results - the result variables are still empty.
ONLY HAPPENS IF switched to another component before the mutationAction is finished.
COMPONENT
STORE
I am using the exact example provided in the ReadMe:
The text was updated successfully, but these errors were encountered: