Skip to content

Commit

Permalink
docs: API for subscribeAction
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 11, 2017
1 parent 71aeaec commit 3a093d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/en/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ const store = new Vuex.Store({ ...options })
Most commonly used in plugins. [Details](plugins.md)
- **`subscribeAction(handler: Function)`**
> New in 2.5.0
Subscribe to store actions. The `handler` is called for every dispatched action and receives the action descriptor and current store state as arguments:
``` js
store.subscribeAction((action, state) => {
console.log(action.type)
console.log(action.payload)
})
```
Most commonly used in plugins. [Details](plugins.md)
- **`registerModule(path: string | Array<string>, module: Module, options?: Object)`**
Register a dynamic module. [Details](modules.md#dynamic-module-registration)
Expand Down

0 comments on commit 3a093d8

Please sign in to comment.