Skip to content

Commit

Permalink
Merge pull request #1604 from renewooller/master
Browse files Browse the repository at this point in the history
docs: qualified that map must only take finite iterables
  • Loading branch information
petkaantonov authored Oct 1, 2019
2 parents 933b5da + b0ed2e4 commit 96f266e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/api/promise.map.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Promise.map(
) -> Promise
```
Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)\(arrays are `Iterable`\), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and [map the array to another](http://en.wikipedia.org/wiki/Map_\(higher-order_function\)) using the given `mapper` function.
Given a finite [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)\(arrays are `Iterable`\), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and [map the array to another](http://en.wikipedia.org/wiki/Map_\(higher-order_function\)) using the given `mapper` function.
Promises returned by the `mapper` function are awaited for and the returned promise doesn't fulfill until all mapped promises have fulfilled as well. If any promise in the array is rejected, or any promise returned by the `mapper` function is rejected, the returned promise is rejected as well.
Expand Down

0 comments on commit 96f266e

Please sign in to comment.