summaryrefslogtreecommitdiff
path: root/lib/race.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-03-09 13:24:52 -0800
committerAlexander Early <alexander.early@gmail.com>2016-03-09 13:24:52 -0800
commit4c88e6c69c9cb057e5bb9867653b29c492003875 (patch)
tree2474e1289a07ae08a48e061d48a2006d054fdee7 /lib/race.js
parentf0efabd6856def2a60b66869d35451ed3f77b445 (diff)
downloadasync-4c88e6c69c9cb057e5bb9867653b29c492003875.tar.gz
remove es6 idioms
Diffstat (limited to 'lib/race.js')
-rw-r--r--lib/race.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/race.js b/lib/race.js
index 4a5f8a5..0ef6914 100644
--- a/lib/race.js
+++ b/lib/race.js
@@ -1,6 +1,7 @@
'use strict';
import isArray from 'lodash/isArray';
+import each from 'lodash/each';
import noop from 'lodash/noop';
import once from 'lodash/once';
@@ -8,7 +9,7 @@ export default function race(tasks, cb) {
cb = once(cb || noop);
if (!isArray(tasks)) return cb(new TypeError('First argument to race must be an array of functions'));
if (!tasks.length) return cb();
- for (let i = 0; i < tasks.length; i++) {
- tasks[i](cb);
- }
+ each(tasks, function (task) {
+ task(cb);
+ });
}