March 2018
Beginner to intermediate
344 pages
7h 7m
English
We can then create a file inside src/store named mutation-types.js, which contains the various actions that the user may take within our application:
export const INCREMENT = 'INCREMENT';export const DECREMENT = 'DECREMENT';export const RESET = 'RESET';
Although we don't have to explicitly define our actions like this, it's a good idea to use constants where possible. This allows us to take better advantage of tooling and linting techniques, as well as allowing us to infer the actions within our entire application at a glance.
Read now
Unlock full access