Skip to main content

Class: SimpleEventDispatcher<T>

Extra-Helpers.SimpleEventDispatcher

Type parameters

NameType
Textends string

Hierarchy

Implements

Constructors

constructor

new SimpleEventDispatcher<T>()

Type parameters

NameType
Textends string

Defined in

webgi/src/helpers/EventDispatcher.ts:39

Methods

addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

void

Implementation of

IEventDispatcher.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:48


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

boolean

Implementation of

IEventDispatcher.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:56


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameType
typeT
listener(event: IEvent<T>) => void

Returns

void

Implementation of

IEventDispatcher.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:63


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<T>

Returns

void

Implementation of

IEventDispatcher.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:74