Hacker News new | ask | show | jobs
by pault 2548 days ago
That's fine, but you'll still only be able to block on one promise at a time. If you want to wait until all promises have resolved you still have to use Promise. all.
1 comments

Promises are started eagerly, so

    const xP = getX();
    const yP = getY();
    const x = await xP;
    const y = await yP;
is just as parallel as

    const [x, y] = Promise.all([getX(), getY()]);
Whoops, you're right! I hadn't thought it through.