From b0ed2e4c38fd5648c2042ab0be41250418fe4b92 Mon Sep 17 00:00:00 2001 From: Rene Date: Fri, 12 Jul 2019 10:37:05 +1000 Subject: [PATCH] docs: qualified that map must only take finite iterables --- docs/docs/api/promise.map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/api/promise.map.md b/docs/docs/api/promise.map.md index e8b267472..e96a3ec09 100644 --- a/docs/docs/api/promise.map.md +++ b/docs/docs/api/promise.map.md @@ -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.