question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntactic Sugar : renderAsync

See original GitHub issue

Is your feature request related to a problem? Please describe. async:true feels a little clunky, when added as an additional parameter for Eta.render()

let result = await Eta.render(
  '<%= it.name %>: <%= await it.asyncFunc() %>',
  { name: 'Ada Lovelace', asyncFunc: asyncFunc },
  { async: true }
)

Describe the solution you’d like Could we have an additional function Eta.renderAsync()

let result = await Eta.renderAsync(
  '<%= it.name %>: <%= await it.asyncFunc() %>',
  { name: 'Ada Lovelace', asyncFunc: asyncFunc }
)

I think this would improve legibility.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
calumkcommented, Nov 28, 2020

Both would be appreciated 👍

0reactions
allcontributors[bot]commented, Nov 28, 2020

@shadowtime2000

I’ve put up a pull request to add @calumk! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How is Suspense different from syntax sugar to render async values ...
No. It's not similar because it's too granular. This is 1:1 relationship between a Promise and a spinner. Suspense is many-to-many.
Read more >
language agnostic - Syntactic sugar vs. feature - Stack Overflow
It turns out to be a feature instead of syntactic sugar when it implies a different way of thinking. You are right when...
Read more >
Templating with ValueTuples. · Issue #107 · StubbleOrg/Stubble ...
Interesting, this should be possible to add but i'm aware that these names are actually syntactic sugar over Item1, ItemX with attributes identifying...
Read more >
Examples of Syntactic Sugar in JavaScript - Sophia Li
Destructuring is syntactic sugar for creating new variables by assigning properties from objects or items from arrays. Destructuring works for ...
Read more >
What writing my own JSX renderer taught me about React - DEV ...
JSX is syntactic sugar for JavaScript. It is compiled down to pure JavaScript, and therefore can only be used if a compile step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found