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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -