File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
1-js/11-async/03-promise-chaining Expand file tree Collapse file tree 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.
3636
3737Here the flow is:
38381 . 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 .
40403 . The value that it returns is passed to the next ` .then ` handler ` (***) `
41414 . ...and so on.
4242
4343As the result is passed along the chain of handlers, we can see a sequence of ` alert ` calls: ` 1 ` -> ` 2 ` -> ` 4 ` .
4444
4545![ ] ( promise-then-chain.svg )
4646
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.
4848
4949When a handler returns a value, it becomes the result of that promise, so the next ` .then ` is called with it.
5050
You can’t perform that action at this time.
0 commit comments