Articles
Latest
More
Newsletter Sponsorship Discord About
Sign up for our Newsletter
The video for this lesson is currently being updated, please read the transcript instead.
Advanced Vue 2 - Vuex & SSR > Lesson 42

Returning a promise from addEvent action

So as I said before that the idea here was that we won't actually mutate the state, in

other words we won't commit this addEvent in our action until we get a successful response

from the server.

So what we're going to do is I'm going to put a then, because Axios methods return a

promise and so therefore you can chain a then on to the end of it and the argument that

you get, you get the response and so we'll create a callback function inside the then


Back to course page

Click to load comments...

Articles
  • Latest
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

Vue.js Developers © 2021. View our privacy policy .

  • RSS
  • |
  • Atom