promises icon indicating copy to clipboard operation
promises copied to clipboard

Update index.md

Open jeff-h opened this issue 5 years ago • 2 comments

Clarify an easy misconception regarding the usage of all.

jeff-h avatar May 15 '20 10:05 jeff-h

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.

ykjchen avatar Aug 09 '20 17:08 ykjchen

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 :)

jeff-h avatar Aug 09 '20 21:08 jeff-h