Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The agent client receives topic notifications about structural changes to the topic tree. In this application, the addition of a topic under /chat/chatsessions will mean that a new user has visited the website.
var registerTopicListener = function (session){
var listener = {
onDescendantNotification: function() {},
onTopicNotification: function(topicPath, topicSpecification, type) {
addUser(topicPath);
},
onClose: function() {},
onError: function(error) {}
};
session.notifications.addListener(listener).then(function(reg) {
reg.select("*chat/chatsessions/");
});
return session;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.