Update pubsubjs to latest version, and add exported module name

This commit is contained in:
Jeremy Scheff
2015-09-18 18:33:11 -04:00
parent 6f6e5c7dd9
commit fc2078411b
2 changed files with 23 additions and 2 deletions
+12
View File
@@ -68,4 +68,16 @@ function test_Hierarchical_addressing() {
// topics, three times in total
// But, mySpecificSubscriber will only be called once, as it only
// subscribes to the 'car.drive' topic
}
function ClearAllSubscriptions() {
// create a function to receive messages
var mySubscriber = (msg: string, data: any) => { console.log(msg, data); }
// create two subscriptions
PubSub.subscribe('topic1', mySubscriber);
PubSub.subscribe('topic2', mySubscriber);
// unsubscribe from all subscrpitions
PubSub.clearAllSubscriptions();
}