-
-
Save kborchers/8a8c43a2f927357c467c 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
// Initialization | |
// by providing channels, subscription could be automatic | |
var notifiers = AeroGear.Notifier([ | |
{ | |
type: "vertx", | |
name: "appNotifications", | |
settings: { | |
connectURL: "someURL", | |
channels: [ | |
{ | |
name: "channel1", | |
callback: function(){} | |
}, | |
{ | |
name: "channel2", | |
callback: function(){} | |
} | |
] | |
} | |
}, | |
{ | |
type: "atmosphere", | |
name: "stockTicker", | |
settings: { | |
connectURL: "someURL", | |
channels: [ | |
{ | |
name: "channel1", | |
callback: function(){} | |
} | |
] | |
} | |
} | |
]).clients; // Or what ever name we want to call these | |
// Usage | |
notifiers.appNotifications.channel1.publish( messageObject ); | |
notifiers.stockTicker.channel1.unsubscribe(); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
base/core API: https://gist.github.com/matzew/bd4f3c41e1114c225eb1