From 8aecf108b3922bc5211036706a0f6f75e02bd42b Mon Sep 17 00:00:00 2001 From: Alex Early Date: Sun, 30 Sep 2018 17:00:10 -0700 Subject: feat: await-able Async methods (#1572) * make each and family awaitable * dont pretend they're AsyncFunctions * check errors * ensure function name is preserved somehow * awaitable concat * awaitable detect * awaitable every/filter * awaitable groupBy * awaitable map/mapValues * awaitable reduce * awaitable reject * awaitable some * awaitable transform * awaitable times * awaitable auto * awaitable compose/seq * awaitable whilst/until (lol) * awaitable forever * awaitable parallel/race * awaitable retry * awaitable series (lol) * awaitable tryEach * awaitable waterfall (lol) * lint * cleanup, remove noop and unused internal functions --- lib/parallel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/parallel.js') diff --git a/lib/parallel.js b/lib/parallel.js index edf8be4..fafae9d 100644 --- a/lib/parallel.js +++ b/lib/parallel.js @@ -1,5 +1,5 @@ import eachOf from './eachOf'; -import parallel from './internal/parallel'; +import _parallel from './internal/parallel'; /** * Run the `tasks` collection of functions in parallel, without waiting until @@ -34,6 +34,7 @@ import parallel from './internal/parallel'; * functions have completed successfully. This function gets a results array * (or object) containing all the result arguments passed to the task callbacks. * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed * * @example * async.parallel([ @@ -70,6 +71,6 @@ import parallel from './internal/parallel'; * // results is now equals to: {one: 1, two: 2} * }); */ -export default function parallelLimit(tasks, callback) { - parallel(eachOf, tasks, callback); +export default function parallel(tasks, callback) { + return _parallel(eachOf, tasks, callback); } -- cgit v1.2.1