Skip to content

Commit

Permalink
docs: Document ctx.app.emit (koajs#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade authored and kiku-jw committed Feb 26, 2019
1 parent 63e4e0e commit 681bf52
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 681bf52

Please sign in to comment.