class JitterListener

A listener for changes in a JitterObject.

Example

var recv = new JitterObject("jit.net.recv");
var mylistener = new JitterListener(recv.getregisteredname(), callbackfun);

function callbackfun(event) {
  if (event.eventname == "matrix_received") {
    matrixoutput(event.args[0]);
  } else if (event.eventname == "message_received") {
    messageoutput(event.args[0]);
  } else if (event.eventname == "connected_notification") {
    connectedoutput();
  }
}
callbackfun.local = 1;

Index

Constructors

Properties

new JitterListener(objectName, callback)

new JitterListener(objectName: string, callback: Function);

Constructs a new instance of the JitterListener class

ParameterTypeDescription
objectNamestringname of the object to listen to
callbackFunctiona function called when a change occurs to the listened-to object which takes a JitterEvent

function Function

The callback function to handle the JitterEvent

object JitterObject

The object being listened to

subjectname string

Name of the object being listened to