1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+
5
+ < meta charset ="utf-8 ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7
+ < title > apply.js - Documentation</ title >
8
+
9
+
10
+ < link rel ="icon " href ="favicon.ico?v=2 ">
11
+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css ">
12
+
13
+ < link rel ="stylesheet " href ="styles/prettify-tomorrow.css ">
14
+
15
+ < link rel ="stylesheet " href ="https://fonts.googleapis.com/css?family=Montserrat:400,700 ">
16
+ < link rel ="stylesheet " href ="styles/jsdoc-default.css ">
17
+
18
+ <!--[if lt IE 9]>
19
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
20
+ <![endif]-->
21
+ < link type ="text/css " rel ="stylesheet " href ="https://cdn.jsdelivr.net/ionicons/2.0.1/css/ionicons.min.css ">
22
+ </ head >
23
+ < body >
24
+
25
+ < div class ="navbar navbar-default navbar-fixed-top ">
26
+ < div class ="navbar-header ">
27
+ < a class ="navbar-brand " href ="# ">
28
+ < img src ="img/async-logo.svg " alt ="Async.js ">
29
+ </ a >
30
+ </ div >
31
+ < ul class ="nav navbar-nav ">
32
+ < li id ="version-dropdown " class ="dropdown ">
33
+ < a href ="# " class ="dropdown-toggle vertically-centered " data-toggle ="dropdown " role ="button " aria-haspopup ="true " aria-expanded ="false "> v2.6.2 < span class ="caret "> </ span >
34
+ </ a >
35
+ < ul class ="dropdown-menu ">
36
+ < li > < a href ="docs.html "> v2.6.2</ a > </ li >
37
+ < li >
38
+ < a href ="https://github.com/caolan/async/blob/v1.5.2/README.md "> v1.5.x</ a >
39
+ </ li >
40
+ </ ul >
41
+ </ li >
42
+ < li > < a href ="./index.html "> Home</ a > </ li >
43
+ < li > < a href ="./docs.html "> Docs</ a > </ li >
44
+ < li > < a href ="https://github.com/caolan/async/blob/master/CHANGELOG.md "> Changelog</ a > </ li >
45
+ < li > < a href ="https://github.com/caolan/async "> < i class ="ion-social-github " aria-hidden ="true "> </ i > </ a > </ li >
46
+ </ ul >
47
+ < ul class ="nav navbar-nav navbar-right ">
48
+ < form class ="navbar-form navbar-left " role ="search ">
49
+ < div class ="form-group ">
50
+ < input type ="text " class ="form-control typeahead " id ="doc-search " placeholder ="Search " autofocus >
51
+ </ div >
52
+ </ form >
53
+ </ ul >
54
+ </ div >
55
+
56
+
57
+ < input type ="checkbox " id ="nav-trigger " class ="nav-trigger ">
58
+ < label for ="nav-trigger " class ="navicon-button x ">
59
+ < div class ="navicon "> </ div >
60
+ </ label >
61
+
62
+ < label for ="nav-trigger " class ="overlay "> </ label >
63
+
64
+ < div id ="main ">
65
+ < div id ="main-container " data-spy ="scroll " data-target ="#toc " data-offset ="50 ">
66
+
67
+ < h1 class ="page-title "> apply.js</ h1 >
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+ < section >
76
+ < article >
77
+ < pre class ="prettyprint source linenums "> < code > import slice from './internal/slice';
78
+
79
+ /**
80
+ * Creates a continuation function with some arguments already applied.
81
+ *
82
+ * Useful as a shorthand when combined with other control flow functions. Any
83
+ * arguments passed to the returned function are added to the arguments
84
+ * originally passed to apply.
85
+ *
86
+ * @name apply
87
+ * @static
88
+ * @memberOf module:Utils
89
+ * @method
90
+ * @category Util
91
+ * @param {Function} fn - The function you want to eventually apply all
92
+ * arguments to. Invokes with (arguments...).
93
+ * @param {...*} arguments... - Any number of arguments to automatically apply
94
+ * when the continuation is called.
95
+ * @returns {Function} the partially-applied function
96
+ * @example
97
+ *
98
+ * // using apply
99
+ * async.parallel([
100
+ * async.apply(fs.writeFile, 'testfile1', 'test1'),
101
+ * async.apply(fs.writeFile, 'testfile2', 'test2')
102
+ * ]);
103
+ *
104
+ *
105
+ * // the same process without using apply
106
+ * async.parallel([
107
+ * function(callback) {
108
+ * fs.writeFile('testfile1', 'test1', callback);
109
+ * },
110
+ * function(callback) {
111
+ * fs.writeFile('testfile2', 'test2', callback);
112
+ * }
113
+ * ]);
114
+ *
115
+ * // It's possible to pass any number of additional arguments when calling the
116
+ * // continuation:
117
+ *
118
+ * node> var fn = async.apply(sys.puts, 'one');
119
+ * node> fn('two', 'three');
120
+ * one
121
+ * two
122
+ * three
123
+ */
124
+ export default function(fn/*, ...args*/) {
125
+ var args = slice(arguments, 1);
126
+ return function(/*callArgs*/) {
127
+ var callArgs = slice(arguments);
128
+ return fn.apply(null, args.concat(callArgs));
129
+ };
130
+ };
131
+ </ code > </ pre >
132
+ </ article >
133
+ </ section >
134
+
135
+
136
+
137
+
138
+ < footer >
139
+ Documentation generated by < a href ="https://github.com/jsdoc3/jsdoc "> JSDoc 3.5.5</ a > on Sun May 26 2019 15:21:49 GMT-0700 (Pacific Daylight Time) using the Minami theme.
140
+ Documentation has been modified from the original. For more information, please see the < a href ="https://github.com/caolan/async "> async</ a > repository.</ footer > </ div >
141
+ </ div >
142
+
143
+ < nav id ="toc ">
144
+ < h3 > Methods:</ h3 > < ul class ="nav methods "> < li class ="toc-header "> < a href ="docs.html#collections "> Collections</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#concat "> concat</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#concatLimit "> concatLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#concatSeries "> concatSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#detect "> detect</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#detectLimit "> detectLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#detectSeries "> detectSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#each "> each</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#eachLimit "> eachLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#eachOf "> eachOf</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#eachOfLimit "> eachOfLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#eachOfSeries "> eachOfSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#eachSeries "> eachSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#every "> every</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#everyLimit "> everyLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#everySeries "> everySeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#filter "> filter</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#filterLimit "> filterLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#filterSeries "> filterSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#groupBy "> groupBy</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#groupByLimit "> groupByLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#groupBySeries "> groupBySeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#map "> map</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#mapLimit "> mapLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#mapSeries "> mapSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#mapValues "> mapValues</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#mapValuesLimit "> mapValuesLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#mapValuesSeries "> mapValuesSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#reduce "> reduce</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#reduceRight "> reduceRight</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#reject "> reject</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#rejectLimit "> rejectLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#rejectSeries "> rejectSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#some "> some</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#someLimit "> someLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#someSeries "> someSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#sortBy "> sortBy</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#transform "> transform</ a > </ li > < li class ="toc-header "> < a href ="docs.html#controlflow "> Control Flow</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#applyEach "> applyEach</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#applyEachSeries "> applyEachSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#auto "> auto</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#autoInject "> autoInject</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#cargo "> cargo</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#compose "> compose</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#doDuring "> doDuring</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#doUntil "> doUntil</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#doWhilst "> doWhilst</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#during "> during</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#forever "> forever</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#parallel "> parallel</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#parallelLimit "> parallelLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#priorityQueue "> priorityQueue</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#queue "> queue</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#race "> race</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#retry "> retry</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#retryable "> retryable</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#seq "> seq</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#series "> series</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#times "> times</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#timesLimit "> timesLimit</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#timesSeries "> timesSeries</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#tryEach "> tryEach</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#until "> until</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#waterfall "> waterfall</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#whilst "> whilst</ a > </ li > < li class ="toc-header "> < a href ="docs.html#utils "> Utils</ a > </ li > < li data-type ="method " class ="toc-method active "> < a href ="docs.html#apply "> apply</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#asyncify "> asyncify</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#constant "> constant</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#dir "> dir</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#ensureAsync "> ensureAsync</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#log "> log</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#memoize "> memoize</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#nextTick "> nextTick</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#reflect "> reflect</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#reflectAll "> reflectAll</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#setImmediate "> setImmediate</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#timeout "> timeout</ a > </ li > < li data-type ="method " class ="toc-method "> < a href ="docs.html#unmemoize "> unmemoize</ a > </ li > </ ul > < h3 > Methods:</ h3 >
145
+ </ nav >
146
+
147
+ < br class ="clear ">
148
+
149
+
150
+
151
+
152
+ < script src ="https://cdn.jsdelivr.net/prettify/0.1/prettify.js "> </ script >
153
+
154
+ < script src ="https://cdn.jsdelivr.net/jquery/2.2.4/jquery.min.js "> </ script >
155
+ < script src ="https://cdn.jsdelivr.net/bootstrap/3.3.6/js/bootstrap.min.js "> </ script >
156
+ < script src ="https://cdn.jsdelivr.net/typeahead.js/0.11.1/typeahead.bundle.min.js "> </ script >
157
+ < script > prettyPrint ( ) ; </ script >
158
+ < script src ="scripts/async.js "> </ script >
159
+
160
+ < script src ="scripts/linenumber.js " async > </ script >
161
+ < script src ="scripts/jsdoc-custom.js " async > </ script >
162
+ </ body >
0 commit comments