Skip to content

Instantly share code, notes, and snippets.

@push-gists
Created April 26, 2016 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save push-gists/311ca9f039529a006c706731cdb06000 to your computer and use it in GitHub Desktop.
Save push-gists/311ca9f039529a006c706731cdb06000 to your computer and use it in GitHub Desktop.
// Create a stream for JSON values
session.stream("foo").asType(jsonType).on({
value : function(topic, specification, newValue, oldValue) {
// Receive the new value of a topic, along with the previous value
},
subscribe : function(topic, specification) {
// Notification of subscription
},
unsubscribe : function(topic, specification, reason) {
// Notification of unsubscription
}
});
// Subscribe to the topic
session.subscribe("foo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment