3 ms·
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
by pault 7y 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.
- Nullabillity 7y agoPromises 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()]);
- pault 7y agoWhoops, you're right! I hadn't thought it through.