javascript - Unsubscribe in Observable KnockOutJS -


im using knockout js , conducted research when observable notified fire function

function functiontosubscribe() {  }  var testobservable = ko.observablearray([]);  testobservable.subscribe(functiontosubscribe); 

i subscribing functiontosubscribe in event

im thinking there way unsubscribe it? in c#? when unsubscribing events have idea regarding this???

the subscribe function returns "subscription" object has dispose method can use unsubscribe:

var testobservable = ko.observablearray([]);  var subscription = testobservable.subscribe(functiontosubscribe);  //call dispose when want unsubscribe subscription.dispose();  

see in documentation: explicitly subscribing observables


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -