Is there a clean way to define/run a callback function once Mustache.js has finished rendering a template and inserting it into the DOM? For example, something like this:
Mustache.render(template, viewModel, function() {...});
The best I've been able to come up with is counting the number of nodes in my view model that will be inserted into the DOM, and then using setInterval to check if that many nodes exist in the DOM. Once they do, I can then call the function I want. This seems inefficient and potentially buggy to me, but I don't know what else to do.