Created
April 3, 2014 03:25
-
-
Save yemaw/9947784 to your computer and use it in GitHub Desktop.
Meteor Rendered Templates Logging with Count
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
if (Meteor.isClient) { | |
//other client side codes | |
function logRenders () { | |
_.each(Template, function (template, name) { | |
var oldRender = template.rendered; | |
var counter = 0; | |
template.rendered = function () { | |
console.log(name, "render count: ", ++counter); | |
oldRender && oldRender.apply(this, arguments); | |
}; | |
}); | |
} | |
logRenders(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment