diff options
author | Alexander Early <alexander.early@gmail.com> | 2017-04-03 01:17:11 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2017-04-03 01:21:22 -0700 |
commit | 67e76ea150f30561e9ce7624459031197c45a68a (patch) | |
tree | 8a789dd8af5efbb133a75e3e04626f493fe1662b /lib/memoize.js | |
parent | 2ae34926f070cdeec38f4bcd0ad173fa6a963904 (diff) | |
download | async-67e76ea150f30561e9ce7624459031197c45a68a.tar.gz |
remove rest completely
Diffstat (limited to 'lib/memoize.js')
-rw-r--r-- | lib/memoize.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/memoize.js b/lib/memoize.js index de71c33..27c08bc 100644 --- a/lib/memoize.js +++ b/lib/memoize.js @@ -1,5 +1,5 @@ import identity from 'lodash/identity'; -import rest from './internal/rest'; +import slice from './internal/slice'; import setImmediate from './internal/setImmediate'; import initialParams from './internal/initialParams'; @@ -61,14 +61,15 @@ export default function memoize(fn, hasher) { queues[key].push(callback); } else { queues[key] = [callback]; - _fn.apply(null, args.concat(rest(function(args) { + _fn.apply(null, args.concat(function(/*args*/) { + var args = slice(arguments); memo[key] = args; var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) { q[i].apply(null, args); } - }))); + })); } }); memoized.memo = memo; |