Skip to content

EventDispatcher.API

Henryk Wollik edited this page Jul 28, 2014 · 1 revision

Class: EventDispatcher

EventDispatcher

new EventDispatcher()

EventDispatcher base class.

Source:

Methods

addEventListener(type, method)

Register an event callback for a certain type.

Parameters:
Name Type Description
type String

The event type

method function

Callback if event is raised

Source:

dispatchEvent(event)

Dispatch an event

Parameters:
Name Type Description
event Event

The event

Source:

getNumListerners() → {*}

Returns the number of listerners for a certain event type.

Source:
Returns:
Type
*

hasEventListener(type) → {Boolean}

Returns true there are listeners for a event type.

Parameters:
Name Type Description
type String

The type

Source:
Returns:
Type
Boolean

removeAllEventListeners()

Completely remove all listeners.

Source:

removeEventListener(type, method)

Remove a callback from the dispatcher.

Parameters:
Name Type Argument Description
type String

= The type

method function <optional>

The callback to be removed (if not specified, all callbacks will be removed)

Source:

Generated with wicked.