Courses
Vue Foundations Vue Fullstack Vue Enterprise
Articles
Latest Topics
More
Newsletter Sponsorship Discord About
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...

Courses
  • Vue Foundations
  • Vue Fullstack
  • Vue Enterprise
Articles
  • Latest
  • Topics
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

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

  • RSS
  • |
  • Atom