by ricardobeat · 14y ago · 0 comments
return Mustache.render(template, data)
Isn't exactly equivalent to the non-promise one, since now `Mustache.render` is async, is it?Functionally the behavior is the same - you're still going to have to gate an asynchronous stream of actions (make sure steps a, b, c have completed before d, etc.), but with this, you can describe that logic where it matters - renderView().then(attachHandlers).then..., instead of callback nesting hell (attachHandlers would have to be in renderView).
But my hope is that more libraries will be accepting promises in a future so one won't have to do the wrapping of a world around.