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
Name | Type | Description |
---|---|---|
type | T | The type of event to listen to. |
listener | (event : IEvent <T >) => void | The 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
Name | Type | Description |
---|---|---|
type | T | The type of event to listen to. |
listener | (event : IEvent <T >) => void | The 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
Name | Type | Description |
---|---|---|
type | T | The type of the listener that gets removed. |
listener | (event : IEvent <T >) => void | The listener function that gets removed. |
Returns
void
Defined in
webgi/src/helpers/EventDispatcher.ts:28
dispatchEvent
▸ dispatchEvent(event
): void
Fire an event type.
Parameters
Name | Type |
---|---|
event | IEvent <T > |
Returns
void