Skip to main content

Class: EventEmitter<T>

A class to create and manage an Event for clients to subscribe to. The emitter can only send one kind of event.

Use this class to send events inside extension or provide API to the other extensions.

Type Parameters

T

Constructors

new EventEmitter()

new EventEmitter<T>(): EventEmitter<T>

Returns

EventEmitter<T>

Properties

event

event: Event<T>

For the public to allow to subscribe to events from this Emitter

Defined in

packages/extension-api/src/extension-api.d.ts:171

Methods

dispose()

dispose(): void

Dispose by removing registered listeners

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:180


fire()

fire(data): void

To fire an event to the subscribers

Parameters

data: T

The event to send to the registered listeners

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:176