Vuex for Everyone
🚧 PLEASE NOTE: An updated version of this course is available! see the Pinia: The Enjoyable Vue Store course. This course is outdated!

Add products to the cart

We’ve gained a theoretical overview of Vuex so far in this course, and in this tutorial, it’s time to implement what we’ve learned.

We’ll create the actual shopping cart in the state and make it functional by setting up the action and mutations necessary.

Remember that Vuex actions are responsible for handling the logic of when a mutation should be fired (dispatched), while mutations have the single responsibility of altering the state.