ListenerHandler

ListenerHandler class: handles add/removing and firing listeners.

Ref: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget#example.

Constructor

new ListenerHandler()

Members

fireEvent

Fire an event: call all associated listeners with the input event object.

Methods

add(type, callback)

Add an event listener.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

The method associated with the provided event type, will be called with the fired event.

remove(type, callback)

Remove an event listener.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

The method associated with the provided event type.