5 ms·
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 t
by cube00 5y ago
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.
- vbezhenar 5y agoAwait 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.
- Aeolun 5y agoMany awaits -> many, many case statements.