Skip to content

@gala-chain/connectAPI


API > EventEmitter

Class: EventEmitter<Events>

Contents

Type parameters

Events extends Record\<string, any>

Constructors

new EventEmitter()

new EventEmitter\<Events>(): EventEmitter\<Events>

Properties

listeners

private listeners: { [K in string | number | symbol]?: Listener<Events[K]>[] } = {}

Source

chain-connect/src/helpers.ts:49

Methods

emit()

emit\<K>(event, data): boolean

Type parameters

K extends string | number | symbol

Parameters

event: K

data: Events[K]

Source

chain-connect/src/helpers.ts:65


off()

off\<K>(event, listener): EventEmitter\<Events>

Type parameters

K extends string | number | symbol

Parameters

event: K

listener: Listener\<Events[K]>

Source

chain-connect/src/helpers.ts:59


on()

on\<K>(event, listener): EventEmitter\<Events>

Type parameters

K extends string | number | symbol

Parameters

event: K

listener: Listener\<Events[K]>

Source

chain-connect/src/helpers.ts:51