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;

Constructors

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

Properties

function Function read-only

The callback function to handle the JitterEvent

object JitterObject read-only

The object being listened to

subjectname string read-only

Name of the object being listened to