-
Notifications
You must be signed in to change notification settings - Fork 229
Promise #288
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
joaquinelio
merged 7 commits into
javascript-tutorial:master
from
cortizg:es.javascript.info.1-11-02-p
Jul 9, 2020
Merged
Promise #288
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cac8c53
traduccion 1-11-02-p
cortizg 4d320d0
Update 1-js/11-async/02-promise-basics/02-delay-promise/task.md
cortizg 5c63ab4
Update 1-js/11-async/02-promise-basics/article.md
cortizg 18550c1
Update 1-js/11-async/02-promise-basics/article.md
cortizg 1ae46e8
Update 1-js/11-async/02-promise-basics/article.md
cortizg e2b24a9
Upd2 1-js/11-async/02-promise-basics/article.md
cortizg e18293e
Upd3 1-js/11-async/02-promise-basics/article.md
cortizg 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
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 @@ | ||
The output is: `1`. | ||
La salida es: `1`. | ||
|
||
The second call to `resolve` is ignored, because only the first call of `reject/resolve` is taken into account. Further calls are ignored. | ||
La segunda llamada a 'resolve' se ignora, porque solo se tiene en cuenta la primera llamada de 'reject/resolve'. Otras llamadas son ignoradas. |
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
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,14 +1,14 @@ | ||
|
||
# Delay with a promise | ||
# Demora con una promesa | ||
|
||
The built-in function `setTimeout` uses callbacks. Create a promise-based alternative. | ||
La función incorporada `setTimeout` utiliza callbacks. Crea una alternativa basada en promesas. | ||
|
||
The function `delay(ms)` should return a promise. That promise should resolve after `ms` milliseconds, so that we can add `.then` to it, like this: | ||
La función `delay(ms)` debería devolver una promesa. Esa promesa debería resolverse después de `ms` milisegundos, para que podamos agregarle `.then`, así: | ||
|
||
```js | ||
function delay(ms) { | ||
// your code | ||
// tu código | ||
} | ||
|
||
delay(3000).then(() => alert('runs after 3 seconds')); | ||
delay(3000).then(() => alert('se ejecuta despues de 3 segundos')); | ||
cortizg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` |
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
10 changes: 5 additions & 5 deletions
10
1-js/11-async/02-promise-basics/03-animate-circle-promise/task.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,15 +1,15 @@ | ||
|
||
# Animated circle with promise | ||
# Círculo animado con promesa | ||
|
||
Rewrite the `showCircle` function in the solution of the task <info:task/animate-circle-callback> so that it returns a promise instead of accepting a callback. | ||
Vuelva a escribir la función `showCircle` en la solución de la tarea <info:task/animate-circle-callback> para que devuelva una promesa en lugar de aceptar un callback. | ||
|
||
The new usage: | ||
Nueva forma de uso: | ||
|
||
```js | ||
showCircle(150, 150, 100).then(div => { | ||
div.classList.add('message-ball'); | ||
div.append("Hello, world!"); | ||
div.append("Hola, mundo!"); | ||
}); | ||
``` | ||
|
||
Take the solution of the task <info:task/animate-circle-callback> as the base. | ||
Tome la solución de la tarea <info:task/animate-circle-callback> como base. |
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
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.