B.Std.Listenable(parent)

The interface that all event listener interfaces must inherit.

PARAMETERS:

{B.Std.Listenable} [parent]

TYPES:

Handler

Event handler callback.

PARAMETERS:

{B.Std.Event} event

Filter

Event filter callback.

PARAMETERS:

{B.Std.Event} event

RETURNS:

{boolean}

true if event will be handled, false otherwise

METHODS:

makeEvent(type, data)

Makes an event object.

PARAMETERS:

{string} type

an event type string

{object} [data]

an optional object of data

RETURNS:

bubbling(enable)

Sets event bubbling enable.

After an event triggers on the listenable, it then triggers on parents in nesting order.

Disabled by default.

PARAMETERS:

{boolean} enable

RETURNS:

bubbling()

Gets event bubbling enable.

RETURNS:

{boolean}

on(events, handler, filter)

Attaches an event handler function for one or more events.

PARAMETERS:

{string} events

one or more space-separated event types

{B.Std.Listenable~Handler} handler

a function to execute when the event is triggered

{B.Std.Listenable~Filter} [filter]

a function to filter the event execution

RETURNS:

off(events, handler, filter)

Detaches an event handler function for one or more events.

PARAMETERS:

{string} events

one or more space-separated event types

{B.Std.Listenable~Handler} handler

a function to execute when the event is triggered

{B.Std.Listenable~Filter} [filter]

a function to filter the event execution

RETURNS:

trigger(one, data)

Executes all attached handlers for the given event type.

listenable.trigger(listenable.makeEvent("eventType", data));
listenable.trigger("eventType", data); // equivalent to above

listenable.trigger("eventTypeA eventTypeB eventTypeC", data); // space-separated event types

PARAMETERS:

{string | B.Std.Event} one

or more space-separated event types or B.Std.Event object

{object} [data]

additional data to pass along to the event handler

RETURNS:

mute(enable)

Mutes event listening.

If the listened is mute, event handler functions will not execute.

Not muted by default.

PARAMETERS:

{boolean} enable

RETURNS:

mute()

Checks if muted.

RETURNS:

{boolean}

TYPES:

METHODS: