when
store.when([method], [name])
Allows you to determine a return value or callback function for any dispatch or commit.
Both method and name are optional, if only one argument is supplied, it is assumed it is the name of the action/mutation.
The method and name can either be a string or regular expression.
The method returns an object with the following methods...