diff options
author | Alex Early <alexander.early@gmail.com> | 2017-04-06 22:41:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-06 22:41:42 -0700 |
commit | b3679d50bee2a98c7b399ed7cbb6cc0081c578e5 (patch) | |
tree | 2d3ba593213b23859e415ed567c90dc3d33a6957 /lib/constant.js | |
parent | c08f87832027f7100f0d0a97593daf53edc00b7a (diff) | |
parent | 6ef3a914a8c94177dd1c3aaecb5a8e6c6dbef9f3 (diff) | |
download | async-b3679d50bee2a98c7b399ed7cbb6cc0081c578e5.tar.gz |
Merge pull request #1395 from caolan/waterfall-optimization
Optimized waterfall, parallel, et al.
Diffstat (limited to 'lib/constant.js')
-rw-r--r-- | lib/constant.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/constant.js b/lib/constant.js index ae6ffd0..238ef61 100644 --- a/lib/constant.js +++ b/lib/constant.js @@ -1,5 +1,4 @@ -import rest from './internal/rest'; -import initialParams from './internal/initialParams'; +import slice from './internal/slice'; /** * Returns a function that when called, calls-back with the values provided. @@ -43,9 +42,11 @@ import initialParams from './internal/initialParams'; * //... * }, callback); */ -export default rest(function(values) { +export default function(/*...values*/) { + var values = slice(arguments); var args = [null].concat(values); - return initialParams(function (ignoredArgs, callback) { + return function (/*...ignoredArgs, callback*/) { + var callback = arguments[arguments.length - 1]; return callback.apply(this, args); - }); -}); + }; +}; |