Last active
August 29, 2015 14:16
-
-
Save skinny/a6d7025b2b3b64e7a932 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
// 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