Created
April 26, 2016 18:26
-
-
Save push-gists/311ca9f039529a006c706731cdb06000 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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