Skip to content

Instantly share code, notes, and snippets.

@jeroenboumans
Last active July 3, 2018 07:26
Show Gist options
  • Select an option

  • Save jeroenboumans/8ec51597f030bb13a339e6cd311ce98e to your computer and use it in GitHub Desktop.

Select an option

Save jeroenboumans/8ec51597f030bb13a339e6cd311ce98e to your computer and use it in GitHub Desktop.
Template for class documentation

EventManager - Class

Constants

Name Type Scope
ADD_ARTICLE String public
CHANGE String public
CHANGE_APIKEY String public

Methods - Public

Methodname Returns Params
AddListener null array [label (String), callback (null)]
RemoveListener boolean array [label (String), callback (null)]
Emit boolean array [label (String), ...args (null)]

Methods - Private

Methodname Returns Params
Init null null

AddListener

Subscribes a callback to given channel (label) on the eventlistener.

EventManager.instance.addListener(EventManager.ADD_ARTICLE, this.myMethod);

RemoveListener

Unsubscribes a callback to given channel (label) on the eventlistener.

EventManager.instance.addListener(EventManager.ADD_ARTICLE, this.myMethod);

Emit

Triggers a channel event to all subscribers with given data/params.

EventManager.instance.addListener(EventManager.ADD_ARTICLE, this.myMethod);`

Init

Initializes the EventManager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment