Detecting when signalR hub is ready after hub.start()
问题 I have a parent and child viewModel. The parent viewmodel starts the signalR connection: $.connection.hub.start() The child viewmodel - one that loads only when the user accesses chat - does the following: chat.server.addUserToChat(self.currentUsername()).done(function() { alert('added'); }); The problem is, the child call is happening before the parent call. I can fix this with a setTimeOut of 1 second, but ideally I could do something like this: $.connection.hub.ready(function(){chat.server