Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Vuex for Everyone

🚧 NOTICE: You are watching a Vue.js 2 lesson

Checkout

In this lesson of the Vuex course, it’s time to let the users check out after they’ve added some sweet stuff to their shopping cart.

A checkout process is usually responsible for multiple things, some of them could be:

  • Checking if the items are still in stock
  • Interacting with the payment processor
  • Emptying the cart
  • Reporting back to the user if the purchase was successful or not

In this vue.js tutorial, we’re doing a simplified version of a checkout process, but what we already know is that multiple things will need to take place.

We’ve said it before, and you probably remember, but we’re going to repeat ourselves: In Vuex, actions are responsible for the logic of when a mutation should be dispatched, while each mutation is only responsible for one single state change.

Can you imagine how we’re going to structure our checkout action?