Skip to content

Instantly share code, notes, and snippets.

@brokenseal
Created September 23, 2014 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brokenseal/d2b5a1b0cad6a77731c5 to your computer and use it in GitHub Desktop.
Save brokenseal/d2b5a1b0cad6a77731c5 to your computer and use it in GitHub Desktop.
How to remove all traces of ko subscription from your memory
var self = this;
setTimeout(function() {
var name;
for(name in self){
if(self.hasOwnProperty(name) && self[name] && self[name].dispose && (typeof self[name].dispose == 'function')){
self[name].dispose()
}
}
}, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment