EventHandler

EventHandler

new EventHandler(acceptedEventHandlersopt)

An EventHandler

Parameters:
Name Type Attributes Default Description
acceptedEventHandlers Array.<String> <optional>
[]

String of allowed events.

Methods

addPipe(eventHandler)

Parameters:
Name Type Description
eventHandler EventHandler

clearEvent(eventNames)

Parameters:
Name Type Description
eventNames String

emit(eventName, …args) → {Boolean}

Parameters:
Name Type Attributes Description
eventName String
args * <repeatable>

Arguments to pass to listeners

Returns:
Type:
Boolean

true if all handlers return true, else false

off(eventNames, eventListener)

Parameters:
Name Type Description
eventNames String
eventListener callback

on(eventNames, eventListener)

Parameters:
Name Type Description
eventNames String
eventListener callback

once(eventName, eventListener)

Parameters:
Name Type Description
eventName String
eventListener callback

removePipe(eventHandler)

Parameters:
Name Type Description
eventHandler EventHandler