Ah oops, so you’re right, in the Promise.resolve(first).then(…) example, the … in the then method call will wait for the value in Promise.resolve to resolve.
This works out for implementing Promise.all though, because while we’re waiting for the first promise in the list of promises to resolve, the other promises in the list…
Hey Yongze! In this case the recursive one works because the promises that are passed to Promise.all have already started executing.
In the example below the first promise will resolve last, and the second promise will resolve slightly before the first one. If you run this snippet with the recursive version of Promise.all…
Oh that’s awesome! Composing generators to build lazy transducers sounds super cool. I’ve never used async generators before, but I’ll have to check out your posts on them.
Thanks for sharing!
Thanks for responding. I read over the article again and already found some errors, so I’m going to start up a fresh system and run through these snippets line by line to make sure I find anything else that’s incorrect or missing.
Sorry for the incorrect information, I’ll let you know if you I run into any questions.