Vuex is a library that we can use with Vue.js to manage different states in an application. If you are building a small application that does not require much data exchange between its components, you are better off not using this library. However, as your application grows, complexities crawl along with it. There will be several components in the application, and, most obviously, you will need to exchange data from one component to another or share the same data across multiple components. That is when Vuex comes to the rescue.
Vue.js also provides an emit method to pass data between different components, which we used in previous chapters. As your application grows, you might also want to update data across several components when your data gets updated.
So, Vuex provides a centralized place to store all the pieces of data in our application. Whenever data changes...