summaryrefslogtreecommitdiff
path: root/lib/apply.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/apply.js')
-rw-r--r--lib/apply.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/apply.js b/lib/apply.js
index d3fc18b..06f630a 100644
--- a/lib/apply.js
+++ b/lib/apply.js
@@ -1,4 +1,4 @@
-import rest from './internal/rest';
+import slice from './internal/slice';
/**
* Creates a continuation function with some arguments already applied.
@@ -12,10 +12,11 @@ import rest from './internal/rest';
* @memberOf module:Utils
* @method
* @category Util
- * @param {Function} function - The function you want to eventually apply all
+ * @param {Function} fn - The function you want to eventually apply all
* arguments to. Invokes with (arguments...).
* @param {...*} arguments... - Any number of arguments to automatically apply
* when the continuation is called.
+ * @returns {Function} the partially-applied function
* @example
*
* // using apply
@@ -44,8 +45,10 @@ import rest from './internal/rest';
* two
* three
*/
-export default rest(function(fn, args) {
- return rest(function(callArgs) {
+export default function(fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ return function(/*callArgs*/) {
+ var callArgs = slice(arguments);
return fn.apply(null, args.concat(callArgs));
- });
-});
+ };
+};