Chapter 6. Understanding Vuex
Vuex is a large topic. Before you learn how to test Vuex in an application in chapter 7, you need to understand the fundamentals of it. In this chapter, you’ll learn what Vuex is and how it makes it easier to manage data in an app.
Note
If you’re already familiar with Vuex, you can skip ahead to the next chapter.
As an app grows in size, so does the data that the app uses. Making sure data stored in different components stays in sync is challenging and can lead to difficult-to-track bugs. Vuex is the solution to that problem.
Vuex is described as a state management library. That description isn’t useful if you don’t know what state means, so the first section of this chapter is about understanding state in the context of a Vue application.
Note
After you understand what state is, I’ll explain to you the problem Vuex solves. Finally I’ll teach you the technical details of Vuex—what a Vuex store is and what parts make up a Vuex store.
First, you need to understand state.