diff options
author | Alexander Early <alexander.early@gmail.com> | 2016-03-19 22:08:12 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2016-03-19 22:08:12 -0700 |
commit | 75fffa0288f44f2929994bee3e96be28c784ee6f (patch) | |
tree | e550061c69cee4204297fc0c8f6be671d59dfebf /lib/retryable.js | |
parent | fa85fcaf02e0689876159465e0490901d03b9bdc (diff) | |
download | async-75fffa0288f44f2929994bee3e96be28c784ee6f.tar.gz |
use initialParams to simplify callback extraction
Diffstat (limited to 'lib/retryable.js')
-rw-r--r-- | lib/retryable.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/retryable.js b/lib/retryable.js index 26fa609..f01d9b9 100644 --- a/lib/retryable.js +++ b/lib/retryable.js @@ -1,14 +1,12 @@ import retry from './retry'; -import rest from 'lodash/rest'; +import initialParams from './internal/initialParams'; export default function (opts, task) { if (!task) { task = opts; opts = null; } - return rest(function (args) { - var callback = args.pop(); - + return initialParams(function (args, callback) { function taskFn(cb) { task.apply(null, args.concat([cb])); } |