I created a SignalR hub which contain the following hub function:
public bool GetStatus()
{
return true;
}
I'm want to call this function from my JS code and get the request of this call. Something like this:
var result = hub.server.getStatus();
if (result)
alert('success');
Is this possible without returning Task of bool?
Thank you.
No. The SignalR JavaScript client is non-blocking; you will need to follow the Promise interface, like so:
hub.server.getStatus().done(function(result) {
if (result) {
alert('success');
}
});