mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
17 lines
283 B
Markdown
17 lines
283 B
Markdown
---
|
|
date: 2020-11-11
|
|
id: 9c42715a-8324-4570-ab92-927b608aa02a
|
|
title: Executing Promises in Parallel
|
|
---
|
|
|
|
``` javascript
|
|
Promise.all([
|
|
asyncFunc1(),
|
|
asyncFunc2(),
|
|
])
|
|
.then(([result1, result2]) => {
|
|
})
|
|
.catch(err => {
|
|
// Receives first rejection among the Promises
|
|
});
|
|
```
|