Because just the top-level field changing invalidates everything in the sub-document, a single attribute change would trigger a re-calculation on all attributes and their dependents. This change should significantly improve performance.
8 lines
198 B
JavaScript
8 lines
198 B
JavaScript
_.each(Template, function (template, name) {
|
|
if(template){
|
|
var counter = 0;
|
|
template.rendered = template.rendered || function () {
|
|
console.log(name, "render count: ", ++counter);
|
|
};
|
|
}
|
|
}); |