8000 Fix: arguments for getters missing in API (#331) · padcom/vuejs.org@356e90a · GitHub
[go: up one dir, main page]

Skip to content

Commit 356e90a

Browse files
LinusBorgyyx990803
authored andcommitted
Fix: arguments for getters missing in API (vuejs#331)
* Fix: arguments for getters missing in API as per `v2.0.0-rc.3`, getters receive 3 arguments: `state, getters, rootState`. However only the first is currently documented. This PR fixes this. * Update api.md fix grammar * remove ")"
1 parent 4a6dee4 commit 356e90a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/en/api.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ const store = new Vuex.Store({ ...options })
4848

4949
- type: `{ [key: string]: Function }`
5050

51-
Register getters on the store. The getter function receives the `state` as the first argument (will be module local state if defined in a module).
52-
51+
Register getters on the store. The getter function receives the following arguments:
52+
53+
```
54+
state, // will be module local state if defined in a module.
55+
getters, // same as store.getters
56+
rootState // same as store.state
57+
```
5358
Registered getters are exposed on `store.getters`.
5459

5560
[Details](getters.md)

0 commit comments

Comments
 (0)
0