Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ef31066

Browse files
committed
minor fixes
1 parent 3de63df commit ef31066

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
`Promise.all` is a great way to parallelize multiple operations. It's especially useful when we need to make parallel requests to multiple services.
55

6-
However, there's a hidden danger. Hopefully we'll be able to identify its cause.
6+
However, there's a hidden danger. We'll see an example in this task and explore how to avoid it.
77

88
Let's say we have a connection to a remote service, such as a database.
99

@@ -39,7 +39,7 @@ function disconnect() {
3939

4040
Now here's the problem.
4141

42-
We write a simple code to connect and send 3 queries in parallel (all of them take different time, e.g. 100, 200 and 300ms), then disconnect:
42+
We wrote the code to connect and send 3 queries in parallel (all of them take different time, e.g. 100, 200 and 300ms), then disconnect:
4343

4444
```js
4545
// Helper function to call async function fn after ms milliseconds
@@ -69,8 +69,8 @@ async function run() {
6969
run();
7070
```
7171

72-
Two of these queries are (by chance) unsuccessful, but we're smart enough to wrap the `Promise.all` call into a `try...catch` block.
72+
Two of these queries are (by chance) unsuccessful, but we handle it by wrapping the `Promise.all` call into a `try..catch` block.
7373

74-
However, this script actually leads to an uncaught error in console!
74+
However, this doesn't help! This script actually leads to an uncaught error in console!
7575

7676
Why? How to avoid it?

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /