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.

Modules

In the previous two lessons we used Vuex to encapsulate the state of our application and standardize how that state gets modified (through actions and mutations). However, as our application gets bigger, we’re going to end up with a gigantic store.js file. This is where Vuex modules come in, allowing us to keep our Vuex code organized and easier to test.

🛑 Problem: We need to organize our code

There has to be a better way to organize our Vuex code, as we’ve just put everything in our store.js file up until this point.

☑️ Solution

Vuex has an option called modules which makes it simple to split out d