November 2017
Beginner to intermediate
398 pages
8h 42m
English
Mutations are synchronous for debugging reasons. The way the state is handled makes it easy to track it and debug faulty behavior in the application since the dev tools can take snapshots of it. But if your mutations make asynchronous calls, then the debugger has no way to tell what the state is before and after the mutation, making it untraceable:
const store = new Vuex.Store({ strict: true, // ... })
This will throw an error when the state is modified outside of a synchronous mutation preventing the debugging tools from working correctly.
Read now
Unlock full access