Skip to content

Commit 7daf865

Browse files
committed
merging all conflicts
2 parents f921d74 + 13da056 commit 7daf865

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

1-js/11-async/05-promise-api/article.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ En la práctica este método casi nunca es usado.
309309
310310
## Resumen
311311
312+
<<<<<<< HEAD
312313
Existen 6 métodos estáticos de la clase `Promise`:
313314
314315
1. `Promise.all(promises)` -- espera que todas las promesas se resuelvan y devuelve un array de sus resultados. Si cualquiera es rechazada se vuelve el error de `Promise.all` y los demás resultados son ignorados.
@@ -321,3 +322,17 @@ Existen 6 métodos estáticos de la clase `Promise`:
321322
6. `Promise.reject(error)` -- crea una promesa rechazada con el "error" dado.
322323
323324
`Promise.all` es probablemente el más común en la práctica.
325+
=======
326+
There are 6 static methods of `Promise` class:
327+
328+
1. `Promise.all(promises)` -- waits for all promises to resolve and returns an array of their results. If any of the given promises rejects, it becomes the error of `Promise.all`, and all other results are ignored.
329+
2. `Promise.allSettled(promises)` (recently added method) -- waits for all promises to settle and returns their results as an array of objects with:
330+
- `status`: `"fulfilled"` or `"rejected"`
331+
- `value` (if fulfilled) or `reason` (if rejected).
332+
3. `Promise.race(promises)` -- waits for the first promise to settle, and its result/error becomes the outcome.
333+
4. `Promise.any(promises)` (recently added method) -- waits for the first promise to fulfill, and its result becomes the outcome. If all of the given promises are rejected, [`AggregateError`](mdn:js/AggregateError) becomes the error of `Promise.any`.
334+
5. `Promise.resolve(value)` -- makes a resolved promise with the given value.
335+
6. `Promise.reject(error)` -- makes a rejected promise with the given error.
336+
337+
Of all these, `Promise.all` is probably the most common in practice.
338+
>>>>>>> 13da056653754765b50aa5a9f706f84a4a0d6293

1-js/11-async/08-async-await/article.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Pero podemos envolverlo dentro de una función async anónima, como esto:
139139
...
140140
})();
141141
```
142+
143+
P.S. The notable exception is V8 engine version 8.9+, where top-level await works in [modules](info:modules).
142144
````
143145
144146
````smart header="*await* acepta \"thenables\""

0 commit comments

Comments
 (0)