Skip to content

Commit 095ccc3

Browse files
talentedunicornktsn
authored andcommitted
docs: Added copy to clarify context (vuejs#1444)
Although it is mentioned further down the document; I think this line will make it more clear especially for newcomers of vuex. I see similar questions regarding this like https://stackoverflow.com/questions/45848974/call-an-action-from-within-another-action
1 parent 0fa5c9f commit 095ccc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guide/actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const store = new Vuex.Store({
2525
})
2626
```
2727

28-
Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call `context.commit` to commit a mutation, or access the state and getters via `context.state` and `context.getters`. We will see why this context object is not the store instance itself when we introduce [Modules](modules.md) later.
28+
Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call `context.commit` to commit a mutation, or access the state and getters via `context.state` and `context.getters`. We can even call other actions with `context.dispatch`. We will see why this context object is not the store instance itself when we introduce [Modules](modules.md) later.
2929

3030
In practice, we often use ES2015 [argument destructuring](https://github.com/lukehoban/es6features#destructuring) to simplify the code a bit (especially when we need to call `commit` multiple times):
3131

0 commit comments

Comments
 (0)