Skip to content

Commit

Permalink
Update promise.each.md (#1317)
Browse files Browse the repository at this point in the history
I fixed a few grammatical issues and moved the sentence "If the iterator function returns a promise..." to the first paragraph where it seems to belong since it's part of the iterator logic. It's a pretty important thing to keep in mind and it seemed like an afterthought.
  • Loading branch information
charlie-s authored and benjamingr committed Jan 13, 2017
1 parent d9a3a62 commit a9af75f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/docs/api/promise.each.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ Promise.each(

[api/promise.each](unfinished-article)

Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given `iterator` function with the signature `(value, index, length)` where `value` is the resolved value of a respective promise in the input array. **Iteration happens serially**. If any promise in the input array is rejected the returned promise is rejected as well.

Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, then the result of the promise is awaited, before continuing with next iteration.
Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given `iterator` function with the signature `(value, index, length)` where `value` is the resolved value of a respective promise in the input array. **Iteration happens serially**. If the iterator function returns a promise or a thenable, then the result of the promise is awaited before continuing with next iteration. If any promise in the input array is rejected, then the returned promise is rejected as well.

Resolves to the original array unmodified. This method is meant to be used for side effects.

<hr>
</markdown></div>
Expand Down

0 comments on commit a9af75f

Please sign in to comment.