Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Asynchronous Template Helpers #667
Hi, i didn't find a proper place to put this question, so please point me if i choose the wrong one.
The problem is that i didn't find a method to use the async functions in the template helpers. Is this possible at all? I just want to put there the app logic which usually require an async db(Mongo) access.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
referenced this issue
Oct 10, 2013
The problem isn't really about adding support for asynchronous template helpers, but more about finding asynchronous templating engines. This is because it is traditionally impossible to have asynchronous code executed by a synchronous function, and when the majority of templating engines are synchronous, there is not much we can do.
To illustrate this, take the following example with eco.
Or just supporting asynchronous templating engines like dust (#401).
Happy to hear some ideas on this.
I was thinking that plugin like partials but more general, would be enough for this task.
This could work the same way as partials, but with some convention about the callback args.