Skip to content

Commit

Permalink
Upgrade: Update now-and-later dependency & add iterator wrapper to ha…
Browse files Browse the repository at this point in the history
…ndle new signature (closes #31)
  • Loading branch information
phated committed Aug 2, 2017
1 parent c456f50 commit 061ccc4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var nowAndLater = require('now-and-later');

var helpers = require('./helpers');

function iterator(fn, key, cb) {
return asyncDone(fn, cb);
}

function buildParallel() {
var args = helpers.verifyArguments(arguments);

Expand All @@ -17,7 +21,7 @@ function buildParallel() {
}

function parallel(done) {
nowAndLater.map(args, asyncDone, extensions, done);
nowAndLater.map(args, iterator, extensions, done);
}

return parallel;
Expand Down
6 changes: 5 additions & 1 deletion lib/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var nowAndLater = require('now-and-later');

var helpers = require('./helpers');

function iterator(fn, key, cb) {
return asyncDone(fn, cb);
}

function buildSeries() {
var args = helpers.verifyArguments(arguments);

Expand All @@ -17,7 +21,7 @@ function buildSeries() {
}

function series(done) {
nowAndLater.mapSeries(args, asyncDone, extensions, done);
nowAndLater.mapSeries(args, iterator, extensions, done);
}

return series;
Expand Down
6 changes: 5 additions & 1 deletion lib/settleParallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var nowAndLater = require('now-and-later');

var helpers = require('./helpers');

function iterator(fn, key, cb) {
return asyncSettle(fn, cb);
}

function buildSettleParallel() {
var args = helpers.verifyArguments(arguments);

Expand All @@ -18,7 +22,7 @@ function buildSettleParallel() {

function settleParallel(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.map(args, asyncSettle, extensions, onSettled);
nowAndLater.map(args, iterator, extensions, onSettled);
}

return settleParallel;
Expand Down
6 changes: 5 additions & 1 deletion lib/settleSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var nowAndLater = require('now-and-later');

var helpers = require('./helpers');

function iterator(fn, key, cb) {
return asyncSettle(fn, cb);
}

function buildSettleSeries() {
var args = helpers.verifyArguments(arguments);

Expand All @@ -18,7 +22,7 @@ function buildSettleSeries() {

function settleSeries(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.mapSeries(args, asyncSettle, extensions, onSettled);
nowAndLater.mapSeries(args, iterator, extensions, onSettled);
}

return settleSeries;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"array-last": "^1.1.1",
"async-done": "^1.2.2",
"async-settle": "^1.0.0",
"now-and-later": "^1.0.0"
"now-and-later": "^2.0.0"
},
"devDependencies": {
"eslint": "^1.7.3",
Expand Down

0 comments on commit 061ccc4

Please sign in to comment.