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

Source

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

Methods

dispose()

dispose(): void

Dispose by removing registered listeners

Returns

void

Source

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


fire()

fire(data): void

To fire an event to the subscribers

Parameters

data: T

Returns

void

Source

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