You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One reason I can think of: not all async functions are async functions, one could also implement asynchrony with just new Promise() and .then().
Secondly, the SO link you included mentions that some transpilers might transform async functions to normal ones. I'm not sure how many people transpile their .eleventy.js but I'm sure there are some.
Just wondering if there is a reason this has to be explicit? e.g.
addNunjucksAsyncFilter()
Wouldn't it be possible to derive this from the
async
keyword that is defined before the callback?Seems a nicer devex, less API's.
For example
addNunjucksFilter('myFilter', async () => {})
See here for detecting an async function, a lot of test runners use this technique; AVA, Tape, etc
https://stackoverflow.com/a/38510353/268820
The text was updated successfully, but these errors were encountered: