new Listenable()

Description

Acts as an interface for anything that should be listenable.

Details

Methods


addListener( callback ) → {callable}

Description

Adds a listener to the current object.

Parameters
Name Type Description
callback callable

callback for when the event occurs

Returns
  • a way to cancel the listener without needing to call removeListener

removeListener( callback )

Description

Removes a listener from the current object.

Parameters
Name Type Description
callback callable

callback that was originally registered


alertListeners(  )

Description

Alerts the listeners that an event occurred. Data passed is optional

Parameters
Name Type Attributes Description
..data * <optional>

Any data desired to be passed to listeners