Skip to content

Commit 0760c90

Browse files
committed
minor fixes
1 parent f775835 commit 0760c90

File tree

1 file changed

+2
-2
lines changed
  • 1-js/11-async/08-async-await/04-promise-all-failure

1 file changed

+2
-2
lines changed

1-js/11-async/08-async-await/04-promise-all-failure/solution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ An ideal solution would be to cancel all unfinished queries when one of them fai
1111

1212
However, the bad news is that service calls (such as `database.query`) are often implemented by a 3rd-party library which doesn't support cancellation. Then there's no way to cancel a call.
1313

14-
Instead we can write our own wrapper function around `Promise.all` which adds a custom `then/catch` handler to each promise to track them: results are gathered and, if an error occurs, all subsequent promises are ignored.
14+
As an alternative, we can write our own wrapper function around `Promise.all` which adds a custom `then/catch` handler to each promise to track them: results are gathered and, if an error occurs, all subsequent promises are ignored.
1515

1616
```js
1717
function customPromiseAll(promises) {
@@ -46,7 +46,7 @@ It may be important that all queries complete, especially if some of them make i
4646

4747
So we should wait until all promises are settled before going further with the execution and eventually disconnecting.
4848

49-
Here's one more implementation. It also resolves with the first error, but waits until all promises are settled.
49+
Here's another implementation. It also resolves with the first error, but waits until all promises are settled.
5050

5151
```js
5252
function customPromiseAllWait(promises) {

0 commit comments

Comments
 (0)