Skip to content

Commit

Permalink
Fix: arguments for getters missing in API (vuejs#331)
Browse files Browse the repository at this point in the history
* 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 ")"
  • Loading branch information
LinusBorg authored and yyx990803 committed Sep 25, 2016
1 parent 4a6dee4 commit 356e90a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/en/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ const store = new Vuex.Store({ ...options })

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

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).

Register getters on the store. The getter function receives the following arguments:

```
state, // will be module local state if defined in a module.
getters, // same as store.getters
rootState // same as store.state
```
Registered getters are exposed on `store.getters`.

[Details](getters.md)
Expand Down

0 comments on commit 356e90a

Please sign in to comment.