Events

Events

Events provides unified event handling for event registering, unregistering, and notifying of registered handlers.

Constructor

new Events()

Source:
See:

Methods

destroy()

Source:

destroy unregisters all handlers and frees internal members.

register(name, handler) → {func}

Source:

register registers an event handler that will fire only for events matching name.

Parameters:
Name Type Description
name string

The event name to register the handler to.

handler EventHandler

The handler function.

Returns:

A function that can be called to unregister the handler.

Type
func

trigger(name, data)

Source:

trigger fires all of the appropriate handlers matching name with data as the event data.

Parameters:
Name Type Description
name string
data Object