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

async/await: direct transpilation to .then(...)? #12196

Closed
d180cf opened this issue Nov 12, 2016 · 1 comment
Closed

async/await: direct transpilation to .then(...)? #12196

d180cf opened this issue Nov 12, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@d180cf
Copy link

d180cf commented Nov 12, 2016

It's good that the current implementation can handle arbitrarily complex async functions, even with await statements inserted in arithmetic expressions run in a loop, but in most practical cases async functions can be easily transpiled into a chain of .then(...) calls. I'm wondering why this approach wasn't taken: transpiling to .then(...) if possible and transpiling to yield if not.

If would be nice to switch to async/await in my project, which is full of .then(...) chains, but it's not possible because even simplest async functions would turn into huge state machines that are neither readable nor debuggable.

@aluanhaddad
Copy link
Contributor

Duplicate of #11725

@vladima vladima added the Duplicate An existing issue was already created label Nov 12, 2016
@vladima vladima closed this as completed Nov 12, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants