Mastering Vuex

Lessons

1. Intro to Vuex

5:13

2. Mastering Vuex Orientation

5:59

3. State & Getters

11:58

4. Mutations & Actions Pt. 1

17:15

5. Mutations & Actions Pt. 2

17:47

6. Modules

15:18

7. Success & Error Notifications

13:47

Although this course was developed with Vue 2, the syntax for Vue 3 with Vuex is virtually the same.

Mutations & Actions Pt. 1

Now that we have access to our Vuex State, we can start to store our application’s data there. With Vuex, we can achieve this by using a Mutation to place data in our State. In this tutorial, we’ll look at Mutations and then see how we can wrap Mutations in Actions to make them more scalable and future-proof.


Mutations

As we discovered in the Intro to Vuex lesson, we can use Mutations to update, or mutate, our State.

For a simple example, let’s say our State has a count property:

store.js