File tree 1 file changed +2
-2
lines changed
1-js/11-async/03-promise-chaining
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,15 @@ The idea is that the result is passed through the chain of `.then` handlers.
36
36
37
37
Here the flow is:
38
38
1 . The initial promise resolves in 1 second ` (*) ` ,
39
- 2 . Then the ` .then ` handler is called ` (**) ` .
39
+ 2 . Then the ` .then ` handler is called ` (**) ` wich in turn creates a new promise .
40
40
3 . The value that it returns is passed to the next ` .then ` handler ` (***) `
41
41
4 . ...and so on.
42
42
43
43
As the result is passed along the chain of handlers, we can see a sequence of ` alert ` calls: ` 1 ` -> ` 2 ` -> ` 4 ` .
44
44
45
45
![ ] ( promise-then-chain.svg )
46
46
47
- The whole thing works, because a call to ` promise .then` returns a promise, so that we can call the next ` .then ` on it.
47
+ The whole thing works, because every call to a ` .then ` returns a new promise, so that we can call the next ` .then ` on it.
48
48
49
49
When a handler returns a value, it becomes the result of that promise, so the next ` .then ` is called with it.
50
50
You can’t perform that action at this time.
0 commit comments