Class: EventDispatcher

.Base. EventDispatcher

A shim for EventTarget. Might be changed to EventTarget later.


new EventDispatcher()

Methods


addEventListener(eventType, listener)

This function registers a callback function as a handler for the corresponding event. It's shortened form is on(eventType, listener). See the event description in the following table.

Parameters:
Name Type Description
eventType string

Event string.

listener function

Callback function.


clearEventListener(eventType)

This function removes all event listeners for one type.

Parameters:
Name Type Description
eventType string

Event string.


removeEventListener(eventType, listener)

This function removes a registered event listener.

Parameters:
Name Type Description
eventType string

Event string.

listener function

Callback function.