Answer the question
In order to leave comments, you need to log in
How to handle promise immediately after dispatch Vue JS?
The problem is that I don’t understand how you can immediately get a response and process it, let’s say there are mounted and computed methods that help to calmly receive data:
mounted(){
this.$store.dispatch('NAME_OF_ACTION')
},
computed: {
getSth() { return this.$store.getters.NAME }
}
this.$store.dispatch('NAME_OF_ACTION').then(promise => console.log(promise))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question