November 2017
Beginner to intermediate
398 pages
8h 42m
English
The final element composing the store is actions. They are different from mutations, because they don't modify the state directly, but they can both commit mutations and make asynchronous operations. Similar to the mutations, actions are declared with a type and a handler. The handler can't be called directly, you need to dispatch an action type like this:
store.dispatch('action-type', payloadObject)
An action handler takes two arguments:
const store = new Vuex.Store({ ...Read now
Unlock full access