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/asyncify.js | |
parent | fa85fcaf02e0689876159465e0490901d03b9bdc (diff) | |
download | async-75fffa0288f44f2929994bee3e96be28c784ee6f.tar.gz |
use initialParams to simplify callback extraction
Diffstat (limited to 'lib/asyncify.js')
-rw-r--r-- | lib/asyncify.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/asyncify.js b/lib/asyncify.js index f9f00e1..cf392e9 100644 --- a/lib/asyncify.js +++ b/lib/asyncify.js @@ -1,11 +1,10 @@ 'use strict'; import isObject from 'lodash/isObject'; -import rest from 'lodash/rest'; +import initialParams from './internal/initialParams'; export default function asyncify(func) { - return rest(function (args) { - var callback = args.pop(); + return initialParams(function (args, callback) { var result; try { result = func.apply(this, args); |