diff --git a/docs/v3/applyEach.js.html b/docs/v3/applyEach.js.html index be2a3e5a6..15dbe2248 100644 --- a/docs/v3/applyEach.js.html +++ b/docs/v3/applyEach.js.html @@ -98,13 +98,14 @@
fns
, is provided, it will
-return a function which lets you pass in the arguments as if it were a single
-function call. The signature is (..args, callback)
. If invoked with any
-arguments, callback
is required.args
to each
+of the functions.async.applyEach([enableSearch, updateSchema], 'bucket', (err, results) => {
+ const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')
+
+appliedFn((err, results) => {
// results[0] is the results for `enableSearch`
// results[1] is the results for `updateSchema`
});
@@ -9420,7 +9421,7 @@ Example
// partial application example:
async.each(
buckets,
- async.applyEach([enableSearch, updateSchema]),
+ async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),
callback
);
@@ -9485,7 +9486,7 @@ Example
- (static) applyEachSeries(fns, …argsopt, callbackopt) → {function}
+ (static) applyEachSeries(fns, …argsopt, callbackopt) → {AsyncFunction}
@@ -9622,9 +9623,9 @@ Returns:
-- If only the first argument is provided, it will return
-a function which lets you pass in the arguments as if it were a single
-function call.
+- A function, that when called, is the result of
+appling the
args
to the list of functions. It takes no args, other than
+a callback.
@@ -9636,7 +9637,7 @@ Returns:
-function
+AsyncFunction
diff --git a/docs/v3/module-ControlFlow.html b/docs/v3/module-ControlFlow.html
index 70273464f..ed1ff8e2a 100644
--- a/docs/v3/module-ControlFlow.html
+++ b/docs/v3/module-ControlFlow.html
@@ -188,7 +188,7 @@ Methods
- (static) applyEach(fns, …argsopt, callbackopt) → {function}
+ (static) applyEach(fns, …argsopt, callbackopt) → {AsyncFunction}
@@ -331,10 +331,9 @@ Returns:
-- If only the first argument,
fns
, is provided, it will
-return a function which lets you pass in the arguments as if it were a single
-function call. The signature is (..args, callback)
. If invoked with any
-arguments, callback
is required.
+- Returns a function that takes no args other than
+an optional callback, that is the result of applying the
args
to each
+of the functions.
@@ -346,7 +345,7 @@ Returns:
-function
+AsyncFunction
@@ -357,7 +356,9 @@ Returns:
Example
- async.applyEach([enableSearch, updateSchema], 'bucket', (err, results) => {
+ const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')
+
+appliedFn((err, results) => {
// results[0] is the results for `enableSearch`
// results[1] is the results for `updateSchema`
});
@@ -365,7 +366,7 @@ Example
// partial application example:
async.each(
buckets,
- async.applyEach([enableSearch, updateSchema]),
+ async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),
callback
);
@@ -430,7 +431,7 @@ Example
- (static) applyEachSeries(fns, …argsopt, callbackopt) → {function}
+ (static) applyEachSeries(fns, …argsopt, callbackopt) → {AsyncFunction}
@@ -567,9 +568,9 @@ Returns:
-- If only the first argument is provided, it will return
-a function which lets you pass in the arguments as if it were a single
-function call.
+- A function, that when called, is the result of
+appling the
args
to the list of functions. It takes no args, other than
+a callback.
@@ -581,7 +582,7 @@ Returns:
-function
+AsyncFunction
diff --git a/lib/applyEach.js b/lib/applyEach.js
index 45462619f..b7f880f45 100644
--- a/lib/applyEach.js
+++ b/lib/applyEach.js
@@ -21,13 +21,14 @@ import map from './map';
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
- * @returns {Function} - If only the first argument, `fns`, is provided, it will
- * return a function which lets you pass in the arguments as if it were a single
- * function call. The signature is `(..args, callback)`. If invoked with any
- * arguments, `callback` is required.
+ * @returns {AsyncFunction} - Returns a function that takes no args other than
+ * an optional callback, that is the result of applying the `args` to each
+ * of the functions.
* @example
*
- * async.applyEach([enableSearch, updateSchema], 'bucket', (err, results) => {
+ * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')
+ *
+ * appliedFn((err, results) => {
* // results[0] is the results for `enableSearch`
* // results[1] is the results for `updateSchema`
* });
@@ -35,7 +36,7 @@ import map from './map';
* // partial application example:
* async.each(
* buckets,
- * async.applyEach([enableSearch, updateSchema]),
+ * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),
* callback
* );
*/
diff --git a/lib/applyEachSeries.js b/lib/applyEachSeries.js
index 6a4d62b6c..ae2661603 100644
--- a/lib/applyEachSeries.js
+++ b/lib/applyEachSeries.js
@@ -16,8 +16,8 @@ import mapSeries from './mapSeries';
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
- * @returns {Function} - If only the first argument is provided, it will return
- * a function which lets you pass in the arguments as if it were a single
- * function call.
+ * @returns {AsyncFunction} - A function, that when called, is the result of
+ * appling the `args` to the list of functions. It takes no args, other than
+ * a callback.
*/
export default applyEach(mapSeries);