Proposal: `await.all {...}` for parallelism

Matthew Morgan mmm211 at zips.uakron.edu
Thu Nov 21 15:54:50 UTC 2019


Why not just use a combination of `async`/`await` and `.then`?

```javascript
async function initialize() {
    const [foo, bar, baz] = await Promise.all([
        request('foo.json').then(t => t.data),
        request('bar.json').then(t => t.data),
        request('baz.json').then(t => t.data),
    ]);
    render(foo, bar, baz);
}
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20191121/0c7170d6/attachment.html>


More information about the es-discuss mailing list