9 ms·
I'm not sure why people (were) downvoting the parent comment. Typescript (and normal Javascript) both support async/await very well as long as you use Babel to
by vedantroy 8y ago
I'm not sure why people (were) downvoting the parent comment.
Typescript (and normal Javascript) both support async/await very well as long as you use Babel to compile your code.
Infact, you don't even need to use Babel to compile your code because a large portion of browsers natively support async/await: https://caniuse.com/#search=async https://caniuse.com/#search=async
I'm not sure why people say you need libraries that support async/await. In JS/TS, async/await are built into the language itself and most libraries utilize the Promise API, which means they also support async/await (since async/await is built on top of promises).
- kahoon 8y agoAnd the TypeScript compiler is now capable of generating the polyfills too, so you don't even need Babel for that: https://bit.ly/2UlW9hs https://bit.ly/2UlW9hs Example taken from here: https://mariusschulz.com/blog/typescript-2-1-async-await-for-es3-es5 https://mariusschulz.com/blog/typescript-2-1-async-await-for...