Skip to content

Commit

Permalink
docs: Document ctx.app.emit (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade authored and dead-horse committed Dec 7, 2018
1 parent f90e825 commit a007198
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/context.md
Expand Up @@ -62,6 +62,10 @@ ctx.state.user = await User.find(id);

Application instance reference.

### ctx.app.emit

Koa applications extend an internal [EventEmitter](https://nodejs.org/dist/latest-v11.x/docs/api/events.html). `ctx.app.emit` emits an event with a type, defined by the first argument. For each event you can hook up "listeners", which is a function that is called when the event is emitted. Consult the [error handling docs](https://koajs.com/#error-handling) for more information.

### ctx.cookies.get(name, [options])

Get cookie `name` with `options`:
Expand Down

0 comments on commit a007198

Please sign in to comment.