Skip to main content

Interface: IEventDispatcher<T>

Core-API.IEventDispatcher

Type parameters

Name
T

Hierarchy

Implemented by

Methods

addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameTypeDescription
typeTThe type of event to listen to.
listener(event: IEvent<T>) => voidThe function that gets called when the event is fired.

Returns

void

Defined in

webgi/src/helpers/EventDispatcher.ts:14


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameTypeDescription
typeTThe type of event to listen to.
listener(event: IEvent<T>) => voidThe function that gets called when the event is fired.

Returns

boolean

Defined in

webgi/src/helpers/EventDispatcher.ts:21


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameTypeDescription
typeTThe type of the listener that gets removed.
listener(event: IEvent<T>) => voidThe listener function that gets removed.

Returns

void

Defined in

webgi/src/helpers/EventDispatcher.ts:28


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<T>

Returns

void

Defined in

webgi/src/helpers/EventDispatcher.ts:34