---
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) &gt; [@loopback/context](./context.md) &gt; [Context](./context.context.md) &gt; [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>

type


</td><td>

string


</td><td>

Event type


</td></tr>
<tr><td>

event


</td><td>

T


</td><td>

Context event


</td></tr>
</tbody></table>
**Returns:**

void


