-
Notifications
You must be signed in to change notification settings - Fork 229
Promises chaining #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vplentinax
merged 9 commits into
javascript-tutorial:master
from
cortizg:es.javascript.info.1-11-03-pc
Jun 10, 2020
Merged
Promises chaining #189
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ad176f6
1-11-03-pc Traducido 11
cortizg 749127f
Update 1-js/11-async/03-promise-chaining/01-then-vs-catch/solution.md
cortizg 78332ee
Update 1-js/11-async/03-promise-chaining/user.json
cortizg a244a6c
Update 1-js/11-async/03-promise-chaining/article.md
cortizg e761598
Update 1-js/11-async/03-promise-chaining/article.md
cortizg ee80a68
Update 1-js/11-async/03-promise-chaining/article.md
cortizg 1f04635
Update 1-js/11-async/03-promise-chaining/article.md
cortizg 4d61e76
Update 1-js/11-async/03-promise-chaining/article.md
cortizg f5a5221
Merge branch 'master' into es.javascript.info.1-11-03-pc
vplentinax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
1-js/11-async/03-promise-chaining/01-then-vs-catch/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| The short answer is: **no, they are not the equal**: | ||
| La respuesta corta es: **no, no son iguales**: | ||
|
|
||
| The difference is that if an error happens in `f1`, then it is handled by `.catch` here: | ||
| La diferencia es que si ocurre un error en `f1`, entonces es manejado por `.catch` aquí: | ||
|
|
||
| ```js run | ||
| promise | ||
| .then(f1) | ||
| .catch(f2); | ||
| ``` | ||
|
|
||
| ...But not here: | ||
| ...Pero no aquí: | ||
|
|
||
| ```js run | ||
| promise | ||
| .then(f1, f2); | ||
| ``` | ||
|
|
||
| That's because an error is passed down the chain, and in the second code piece there's no chain below `f1`. | ||
| Esto se debe a que se pasa un error por la cadena y en la segunda pieza del código no hay una cadena debajo de `f1`. | ||
|
|
||
| In other words, `.then` passes results/errors to the next `.then/catch`. So in the first example, there's a `catch` below, and in the second one -- there isn't, so the error is unhandled. | ||
| En otras palabras, `.then` pasa los resultados/errores al siguiente `.then/catch`. Entonces, en el primer ejemplo, hay un `catch` debajo, y en el segundo no lo hay, por lo que el error no se maneja. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| function getMessage() { | ||
| return "Hello, world!"; | ||
| return "Hola, mundo!"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 1 addition & 58 deletions
59
1-js/11-async/03-promise-chaining/promise-handler-variants.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "name": "iliakan", | ||
| "nombre": "iliakan", | ||
|
cortizg marked this conversation as resolved.
Outdated
|
||
| "isAdmin": true | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.