DEV Community

Discussion on: When do you use generator based library for async programming instead of the async/await?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

co seems old -- 5 years ago.

Async paradigm has criticisms -- namely, watching what's inside, and cancelling.

Observable is a solution to this. A biggest player in this is RxJS. The pattern is not limited to JavaScript. (Not sure if the library started from Java, actually.)

Triggering changes from outside is possible for observables too.

Collapse
 
machy44 profile image
machy44

Aha, now I realized. You cannot pause async function but you can do it with generators. I did not think about that. Thank you for your reply. You were very helpful. I have never worked with RxJS and I will certainly take a look.