Skip to content

Commit 1b889aa

Browse files
authored
describe options argument of dispatch/commit in api docs (#743)
1 parent 4a21381 commit 1b889aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/en/api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ const store = new Vuex.Store({ ...options })
5454
state, // will be module local state if defined in a module.
5555
getters // same as store.getters
5656
```
57-
57+
5858
Specific when defined in a module
59-
59+
6060
```
6161
state, // will be module local state if defined in a module.
6262
getters, // module local getters of the current module
6363
rootState, // global state
6464
rootGetters // all getters
6565
```
66-
66+
6767
Registered getters are exposed on `store.getters`.
6868

6969
[Details](getters.md)
@@ -125,13 +125,13 @@ const store = new Vuex.Store({ ...options })
125125
126126
### Vuex.Store Instance Methods
127127
128-
- **`commit(type: string, payload?: any) | commit(mutation: Object)`**
128+
- **`commit(type: string, payload?: any, options?: Object) | commit(mutation: Object, options?: Object)`**
129129
130-
Commit a mutation. [Details](mutations.md)
130+
Commit a mutation. `options` can have `root: true` that allows to commit root mutations in [namespaced modules](modules.md#namespacing). [Details](mutations.md)
131131
132-
- **`dispatch(type: string, payload?: any) | dispatch(action: Object)`**
132+
- **`dispatch(type: string, payload?: any, options?: Object) | dispatch(action: Object, options?: Object)`**
133133
134-
Dispatch an action. Returns a Promise that resolves all triggered action handlers. [Details](actions.md)
134+
Dispatch an action. `options` can have `root: true` that allows to dispatch root actions in [namespaced modules](modules.md#namespacing). Returns a Promise that resolves all triggered action handlers. [Details](actions.md)
135135
136136
- **`replaceState(state: Object)`**
137137

0 commit comments

Comments
 (0)