If the live data feed is to be used, this section should be skipped as it is MUCH more efficient to allow the start of the live data feed to cause the relevant data fetch to occur.
This facility is intended for applications which want to load static data only and have no need for live updates.
or as a Promise:
Using live data
The API does not assume that you want a live data feed. A live feed will also allow events (below) to be used. To initialise the live data feed use:
or as a Promise:
It can be stopped by logging out or with:
Events and listeners
Responding to events / Listeners
Most objects support at least 2 events, 'new' and 'update', which the calling application can subscribe to notifications on.
The returned object has just been created. This listener must be added to the top-level class definition (
IPCortex.Types.*class*) as the listener cannot be added to an object that does not yet exist.
The addListener call returns the callback on success, or null on failure.
NOTE: Adding this listener will not currently report any historically created objects.
A change of some kind has occurred on the returned object. This listener, and all other of its kind can be added to either a specific object instance, or to the top-level class.
A listener will be cleaned up if an object is destroyed (eg. a dead call or closed room), but may also be removed by supplying the original parameters to the removeListener method:
If a callback throws an error, or if it cannot be called, it will also be removed automatically.
The listener callback
The listener callback is called with a single parameter containing a reference to the 'new' or 'updated' object. It is up to the application to determine the nature of the change.