Hacker News new | past | comments | ask | show | jobs | submit login

It's interesting using async/await, setting the target ES to be an older version and watching how the TypeScript compiler replaces async/await with yields and then no yields but a ton of scary looking boilerplate as you progress further back through older versions of ES.



Await basically splits function in two functions (before and after) and uses second function as a callback for promise then. Error handling makes it a little bit more complex, but not much. Babel seems to make it harder than it needs to be, but may be that makes sense from performance or maintainability perspective.


Many awaits -> many, many case statements.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: