Created
September 16, 2014 08:37
-
-
Save marcodejongh/694f156c18eba0e8ab8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oldDestroy = Blaze.DOMRange._destroy; | |
var counter, domTimeout, startTime, endTime; | |
Blaze.DOMRange._destroy = function () { | |
//I love monkey-patching | |
if(monitorBlaze) { | |
endTime = new Date().getTime(); | |
if(domTimeout) { | |
Meteor.clearTimeout(domTimeout); | |
} else { | |
counter = 0; | |
console.log('Blaze voodoo magic commences'); | |
startTime = new Date().getTime(); | |
} | |
domTimeout = Meteor.setTimeout(function () { | |
console.log('Blaze magic finishes with: ' + counter + ' destroys' + ' done in ' + (endTime - startTime) + 'ms' ); | |
monitorBlaze = false; | |
domTimeout = null; | |
}, 1000); | |
counter++; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment