3 Object.defineProperty(exports, "__esModule", {
7 var _rest = require('./internal/rest');
9 var _rest2 = _interopRequireDefault(_rest);
11 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14 * Creates a continuation function with some arguments already applied.
16 * Useful as a shorthand when combined with other control flow functions. Any
17 * arguments passed to the returned function are added to the arguments
18 * originally passed to apply.
22 * @memberOf module:Utils
25 * @param {Function} function - The function you want to eventually apply all
26 * arguments to. Invokes with (arguments...).
27 * @param {...*} arguments... - Any number of arguments to automatically apply
28 * when the continuation is called.
33 * async.apply(fs.writeFile, 'testfile1', 'test1'),
34 * async.apply(fs.writeFile, 'testfile2', 'test2')
38 * // the same process without using apply
40 * function(callback) {
41 * fs.writeFile('testfile1', 'test1', callback);
43 * function(callback) {
44 * fs.writeFile('testfile2', 'test2', callback);
48 * // It's possible to pass any number of additional arguments when calling the
51 * node> var fn = async.apply(sys.puts, 'one');
52 * node> fn('two', 'three');
57 exports.default = (0, _rest2.default)(function (fn, args) {
58 return (0, _rest2.default)(function (callArgs) {
59 return fn.apply(null, args.concat(callArgs));
62 module.exports = exports['default'];