Promise by bogdanbacosca · Pull Request #150 · javascript-tutorial/ro.javascript.info
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
Promise #150
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions
1-js/11-async/02-promise-basics/01-re-resolve/solution.md
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| The output is: `1`. | ||
| Rezultatul este: `1`. | ||
|
|
||
| The second call to `resolve` is ignored, because only the first call of `reject/resolve` is taken into account. Further calls are ignored. | ||
| Al doilea apel la `resolve` este ignorat, deoarece doar primul apel la `reject/resolve` este luat în considerare. Apelurile ulterioare sunt ignorate. |
4 changes: 2 additions & 2 deletions
1-js/11-async/02-promise-basics/01-re-resolve/task.md
4 changes: 2 additions & 2 deletions
1-js/11-async/02-promise-basics/02-delay-promise/solution.md
10 changes: 5 additions & 5 deletions
1-js/11-async/02-promise-basics/02-delay-promise/task.md
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
|
|
||
| # Delay with a promise | ||
| # Întârzie cu o promisiune | ||
|
|
||
| The built-in function `setTimeout` uses callbacks. Create a promise-based alternative. | ||
| Funcția încorporată `setTimeout` utilizează callback-uri. Creați o alternativă bazată pe promisiuni. | ||
|
|
||
| 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: | ||
| Funcția `delay(ms)` ar trebui să returneze o promisiune. Această promisiune ar trebui să se rezolve după `ms` milisecunde, astfel încât să putem adăuga `.then` la ea, astfel: | ||
|
|
||
| ```js | ||
| function delay(ms) { | ||
| // your code | ||
| // codul tău | ||
| } | ||
|
|
||
| delay(3000).then(() => alert('runs after 3 seconds')); | ||
| delay(3000).then(() => alert('rulează după 3 secunde')); | ||
| ``` |
8 changes: 4 additions & 4 deletions
1-js/11-async/02-promise-basics/03-animate-circle-promise/task.md
290 changes: 145 additions & 145 deletions
1-js/11-async/02-promise-basics/article.md
2 changes: 1 addition & 1 deletion
1-js/11-async/02-promise-basics/head.html