Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntactic Sugar : renderAsync #49

Closed
calumk opened this issue Nov 28, 2020 · 5 comments · Fixed by #50
Closed

Syntactic Sugar : renderAsync #49

calumk opened this issue Nov 28, 2020 · 5 comments · Fixed by #50
Labels
enhancement New feature or request

Comments

@calumk
Copy link

calumk commented Nov 28, 2020

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.

@shadowtime2000
Copy link
Collaborator

shadowtime2000 commented Nov 28, 2020

Hi,
This seems like a good idea, I think this could make it more compatible with the JSTransformer template engine standard.

@shadowtime2000 shadowtime2000 added the enhancement New feature or request label Nov 28, 2020
@shadowtime2000
Copy link
Collaborator

Along with renderAsync we could also do a renderFileAsync function.

@calumk
Copy link
Author

calumk commented Nov 28, 2020

Both would be appreciated 👍

@shadowtime2000
Copy link
Collaborator

@all-contributors please add @calumk for ideas

@allcontributors
Copy link
Contributor

@shadowtime2000

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants