diff options
Diffstat (limited to 'lib/seq.js')
-rw-r--r-- | lib/seq.js | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,5 +1,5 @@ import noop from 'lodash/noop'; -import rest from './internal/rest'; +import slice from './internal/slice'; import reduce from './reduce'; import wrapAsync from './internal/wrapAsync'; import arrayMap from 'lodash/_arrayMap'; @@ -42,9 +42,10 @@ import arrayMap from 'lodash/_arrayMap'; * }); * }); */ -export default rest(function seq(functions) { - var _functions = arrayMap(functions, wrapAsync); - return rest(function(args) { +export default function seq(/*...functions*/) { + var _functions = arrayMap(arguments, wrapAsync); + return function(/*...args*/) { + var args = slice(arguments); var that = this; var cb = args[args.length - 1]; @@ -55,12 +56,13 @@ export default rest(function seq(functions) { } reduce(_functions, args, function(newargs, fn, cb) { - fn.apply(that, newargs.concat(rest(function(err, nextargs) { + fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) { + var nextargs = slice(arguments, 1); cb(err, nextargs); - }))); + })); }, function(err, results) { cb.apply(that, [err].concat(results)); }); - }); -}) + }; +} |