@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
81 lines (41 loc) • 1.15 kB
Markdown
---
lang: en
title: 'API docs: context.context.emitevent'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.context.emitevent.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [emitEvent](./context.context.emitevent.md)
## Context.emitEvent() method
A strongly-typed method to emit context events
**Signature:**
```typescript
emitEvent<T extends ContextEvent>(type: string, event: T): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
type
</td><td markdown="1">
string
</td><td markdown="1">
Event type
</td></tr>
<tr><td markdown="1">
event
</td><td markdown="1">
T
</td><td markdown="1">
Context event
</td></tr>
</tbody></table>
**Returns:**
void