API Documentation

for 0.0.1
Show:

EventEmitter Class

EventEmitter is a helper class to handle event emission

Constructor

EventEmitter

(
  • params
)

Parameters:

  • params Object

    The parameters object

    • [scope] Mixed optional

      The scope to use for callbacks, should usually be set to the class instance using the EventEmitter. Defaults to the EventEmitter instance if not specified

Item Index

Methods

Methods

off

(
  • type
  • [callback]
)
chainable

Remove an event listener

Parameters:

  • type String

    The event type to stop listen to

  • [callback] Function optional

    The callback function associated with the listener. If not specified, all listeners will be removed

on

(
  • type
  • callback
)
chainable

Add an event listener

Parameters:

  • type String

    The event type to listen to

  • callback Function

    The callback to call when the event is captured

trigger

(
  • type
  • [data]
)
chainable

Trigger an event

Parameters:

  • type String

    The event type

  • [data] Mixed optional multiple

    Data to send along with the event