SalientBrain
SalientBrain

Reputation: 2541

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?

Upvotes: 2

Views: 573

Answers (1)

Bergi
Bergi

Reputation: 664297

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.

Upvotes: 1

Related Questions