diff --git a/docs/api/context.md b/docs/api/context.md index d05e8e1a5..16e0ccd02 100644 --- a/docs/api/context.md +++ b/docs/api/context.md @@ -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`: