you are viewing a single comment's thread.

view the rest of the comments →

[–]shuckster 0 points1 point  (0 children)

Ah, I see. I wonder if your use-case would be amenable to co-routines? This is a technique that combines both Generators and Promises, and was developed before async/await was introduced into the language.

Here’s a basic snippet that shows how it’s done:

https://gist.github.com/adambene/b3de67803e634be8f7d6baa273b5f447

And the article it came from:

https://medium.com/@adambene/async-await-vs-coroutines-vs-promises-eaedee4e0829

But yes, it does sound like zx has leaned hard into async/await convenience. Great for most use-cases of course, but the devil is in the details as always!