Class: Events

og/Events~Events

Base events class to handle custom events.

new Events(eventNames)

Name Type Description
eventNames Array.<string> optional Event names that could be dispatched.

Members

protected_counternumber

Event identifier.

protected_eventNamesArray.<string>

Registered event names.

protected_stopPropagationboolean

Stop propagation flag

Methods

protected_stamp(name, obj){boolean}

Returns true if event callback has stamped.
Name Type Description
name Object Event identifier.
obj Object Event callback.
Returns:
Type Description
boolean -
Removes all events.

dispatch(event, obj)

Dispatch event.
Name Type Description
event Object Event instance property that created by event name.
obj Object optional Event object.

off(name, callback)

Stop listening event name with specified callback function.
Name Type Description
name string Event name.
callback eventCallback Attached event callback.

on(name, callback, sender)

Attach listener.
Name Type Description
name string Event name to listen.
callback eventCallback Event callback function.
sender Object Event callback function owner.

registerNames(eventNames)

Function that creates event object properties that would be dispatched.
Name Type Description
eventNames Array.<string> Specified event names list.

stopPropagation()

Brakes events propagation.