Skip to content

Conversation

@jeff-h
Copy link
Contributor

@jeff-h jeff-h commented May 15, 2020

Clarify an easy misconception regarding the usage of all.

Clarify an easy misconception regarding the usage of `all`.
@ykjchen
Copy link
Contributor

ykjchen commented Aug 9, 2020

Thanks for the addition @jeff-h. What do you think about this:

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.

This:

  1. makes the doc specific to all, since the comment is added in the all section (if the documentation is more general, perhaps the extensions section is more appropriate);
  2. clarifies that the order of the returned object is clearly defined;
  3. adds details on why -all: does not control order of resolution.

@jeff-h
Copy link
Contributor Author

jeff-h commented Aug 9, 2020

Hey — I like it. It provides more detail than my attempt & would certainly have alleviated my initial misunderstandings on this. TBH when my brain is in the right space the situation re all is self-evident, so anything in the docs that prompts a deeper think would do the trick :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants