Skip to content
This repository was archived by the owner on Jan 23, 2020. It is now read-only.

Latest commit

 

History

History
33 lines (25 loc) · 1.34 KB

File metadata and controls

33 lines (25 loc) · 1.34 KB

cs.Event - is system object, that handles events subscribing and dispatching, instance can be obtained in such way:

Event = window.cs.Event;

Object is the similar to $Event object on backend, see examples.

###[Up](#) Methods

Event object has next public methods:

  • on()
  • off()
  • once()
  • fire()

Subscribing for event. More details, and example of use Callback might either return boolean value or Promise object.

off(event : string, callback : function) : cs.Event

Unsubscribing from event. More details, and example of use Callback might either return boolean value or Promise object.

once(event : string, callback : function) : cs.Event

Subscribing for event for single execution. More details, and example of use Callback might either return boolean value or Promise object.

fire(event : string, callback : function) : Promise

Dispatching of event. More details, and example of use Will return Promise object, since event handlers might be asynchronous.