All your mutations must be synchronous, so how do you do things such as waiting for a timeout or using Axios for an AJAX request? Actions are the next level of abstraction that will help you with this. Inside an action, you can commit multiple mutations and make asynchronous operations.
Listing your actions in Vuex
Getting ready
Mutations are the building blocks of actions, so it's highly suggested you complete the preceding recipe before trying this.
We will be using the setup from the Building a simple storage for the application state recipe; you can use your own as well, but in any case this recipe is based on a slight modification of the official Webpack template.