javascript - How to unsubscribe from event handler in SignalR hub proxy? -


i working javascript signalr client. open hub connection like:

hubconnection = $.hubconnection(url); proxy= hubconnection.createhubproxy('somehub'); 

when want subscribe hub event:

proxy.on("someevent", function(somedata){     console.log(somedata); }); 

how unsubscribe listening hub event? tried proxy.off("someevent"); doesn't work.

use off method:

var mycallback = function(somedata) {     console.log(somedata); }  proxy.on("someevent", mycallback);  proxy.off("someevent", mycallback); 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -