Skip to content

Instantly share code, notes, and snippets.

@skinny
Last active August 29, 2015 14:16
Show Gist options
  • Save skinny/a6d7025b2b3b64e7a932 to your computer and use it in GitHub Desktop.
Save skinny/a6d7025b2b3b64e7a932 to your computer and use it in GitHub Desktop.
// WORKS
// Receives messages from both 'All' & '7' channels
var connection = $.hubConnection();
var proxy = connection.createHubProxy('applicationHub');
var init = function () {
proxy.invoke('joinGroup', 7);
deferred.resolve(proxy);
}
proxy.on('newTask', function (arg) {
console.log('new task ' + arg);
});
connection.start({ withCredentials: false }).done(init);
// DOESNT WORK (for 'All' channel)
// Receives only messages from '7' channel
var connection = $.hubConnection();
var proxy = connection.createHubProxy('applicationHub');
var init = function () {
proxy.invoke('joinGroup', 7);
proxy.on('newTask', function (arg) {
console.log('new task ' + arg);
});
deferred.resolve(proxy);
}
connection.start({ withCredentials: false }).done(init);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment