diff options
author | Alexander Early <alexander.early@gmail.com> | 2017-03-25 15:26:14 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2017-03-25 15:26:14 -0700 |
commit | db9face308f5d00ca98c8d3c2080949b1db50ab7 (patch) | |
tree | fa70cc16dc33fbb4921dcde8deae8b3578b5640a /lib/timesLimit.js | |
parent | ffd66850df894a5a961c8f2d21d75d0796448ce9 (diff) | |
download | async-db9face308f5d00ca98c8d3c2080949b1db50ab7.tar.gz |
handle async funcs in control flow methods
Diffstat (limited to 'lib/timesLimit.js')
-rw-r--r-- | lib/timesLimit.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/timesLimit.js b/lib/timesLimit.js index 68d5ede..7ba91d6 100644 --- a/lib/timesLimit.js +++ b/lib/timesLimit.js @@ -1,5 +1,6 @@ import mapLimit from './mapLimit'; import range from 'lodash/_baseRange'; +import wrapAsync from './internal/wrapAsync'; /** * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a @@ -18,5 +19,6 @@ import range from 'lodash/_baseRange'; * @param {Function} callback - see [async.map]{@link module:Collections.map}. */ export default function timeLimit(count, limit, iteratee, callback) { - mapLimit(range(0, count, 1), limit, iteratee, callback); + var _iteratee = wrapAsync(iteratee); + mapLimit(range(0, count, 1), limit, _iteratee, callback); } |