Skip to content

Commit

Permalink
Merge pull request #163 from ykjchen/document-all
Browse files Browse the repository at this point in the history
Add documentation to +all: that clarifies the order in which promises…
  • Loading branch information
ykjchen authored Jan 18, 2024
2 parents 027c9fe + 8e0cfff commit 5b6daa4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions g3doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,12 @@ they've been fulfilled, the promise returned from `all` is fulfilled with an
array of all fulfilled values. If one of the given promises is rejected, then
the returned promise is rejected with the same error.
Note that `all` does not control when each contained promise task starts
(a promise task starts when that promise is created), nor when each promise
is resolved (this depends on the length of the task). However, it does
guarantee that the order of promises in the output array is identical to the
order of promises passed to it in the input array.
In Swift, the `all` operator also allows passing promises of heterogeneous
types. For this case, the returned promise will be resolved with a tuple
containing the values of the input promises in the same order they were
Expand Down

0 comments on commit 5b6daa4

Please sign in to comment.