Skip to content

Instantly share code, notes, and snippets.

@brokenseal
Created September 23, 2014 07:41
Show Gist options
  • Select an option

  • Save brokenseal/d2b5a1b0cad6a77731c5 to your computer and use it in GitHub Desktop.

Select an option

Save brokenseal/d2b5a1b0cad6a77731c5 to your computer and use it in GitHub Desktop.

Revisions

  1. brokenseal created this gist Sep 23, 2014.
    10 changes: 10 additions & 0 deletions ko-dispose
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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);