javascripttypescriptasync-awaitgeneratorco

TypeScript async/await vs JS tj/co


Do I understand correctly that I do not need to use libs like tj/co in TypeScript to control flow, since I can use async/await? Using promises with generators is just a workaround for async/await?


Solution

  • I do not need to use libs like tj/co in TypeScript to control flow, since I can use async/await?

    Yes.

    Using promises with generators is just a workaround for async/await?

    Yes. Generators and async runners were used in ES6 to emulate async/await and get the syntactic sugar everyone longed for. Now with ES8 you can await your promises directly.