Skip to content
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

Add documentation to +all: that clarifies the order in which promises… #163

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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