Skip to content

Commit

Permalink
fix(docs): applyEach docs. Closes #1658
Browse files Browse the repository at this point in the history
  • Loading branch information
aearly committed Jun 23, 2019
1 parent 3df9196 commit 028e1e6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 44 deletions.
13 changes: 7 additions & 6 deletions docs/v3/applyEach.js.html
Expand Up @@ -98,21 +98,22 @@ <h1 class="page-title">applyEach.js</h1>
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {Function} - If only the first argument, `fns`, is provided, it will
* return a function which lets you pass in the arguments as if it were a single
* function call. The signature is `(..args, callback)`. If invoked with any
* arguments, `callback` is required.
* @returns {AsyncFunction} - Returns a function that takes no args other than
* an optional callback, that is the result of applying the `args` to each
* of the functions.
* @example
*
* async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;, (err, results) =&gt; {
* const appliedFn = async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;)
*
* appliedFn((err, results) =&gt; {
* // results[0] is the results for `enableSearch`
* // results[1] is the results for `updateSchema`
* });
*
* // partial application example:
* async.each(
* buckets,
* async.applyEach([enableSearch, updateSchema]),
* async (bucket) =&gt; async.applyEach([enableSearch, updateSchema], bucket)(),
* callback
* );
*/
Expand Down
6 changes: 3 additions & 3 deletions docs/v3/applyEachSeries.js.html
Expand Up @@ -93,9 +93,9 @@ <h1 class="page-title">applyEachSeries.js</h1>
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {Function} - If only the first argument is provided, it will return
* a function which lets you pass in the arguments as if it were a single
* function call.
* @returns {AsyncFunction} - A function, that when called, is the result of
* appling the `args` to the list of functions. It takes no args, other than
* a callback.
*/
export default applyEach(mapSeries);
</code></pre>
Expand Down
27 changes: 14 additions & 13 deletions docs/v3/docs.html
Expand Up @@ -9243,7 +9243,7 @@ <h3 class="subsection-title">Methods</h3>



<h4 class="name" id="applyEach"><span class="type-signature">(static) </span>applyEach<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>
<h4 class="name" id="applyEach"><span class="type-signature">(static) </span>applyEach<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="global.html">AsyncFunction</a>}</span></h4>



Expand Down Expand Up @@ -9386,10 +9386,9 @@ <h5>Returns:</h5>

<div class="param-desc">
<ul>
<li>If only the first argument, <code>fns</code>, is provided, it will
return a function which lets you pass in the arguments as if it were a single
function call. The signature is <code>(..args, callback)</code>. If invoked with any
arguments, <code>callback</code> is required.</li>
<li>Returns a function that takes no args other than
an optional callback, that is the result of applying the <code>args</code> to each
of the functions.</li>
</ul>
</div>

Expand All @@ -9401,7 +9400,7 @@ <h5>Returns:</h5>
</dt>
<dd>

<span class="param-type">function</span>
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


</dd>
Expand All @@ -9412,15 +9411,17 @@ <h5>Returns:</h5>

<h5>Example</h5>

<pre class="prettyprint"><code>async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;, (err, results) =&gt; {
<pre class="prettyprint"><code>const appliedFn = async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;)

appliedFn((err, results) =&gt; {
// results[0] is the results for `enableSearch`
// results[1] is the results for `updateSchema`
});

// partial application example:
async.each(
buckets,
async.applyEach([enableSearch, updateSchema]),
async (bucket) =&gt; async.applyEach([enableSearch, updateSchema], bucket)(),
callback
);</code></pre>

Expand Down Expand Up @@ -9485,7 +9486,7 @@ <h5>Example</h5>



<h4 class="name" id="applyEachSeries"><span class="type-signature">(static) </span>applyEachSeries<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>
<h4 class="name" id="applyEachSeries"><span class="type-signature">(static) </span>applyEachSeries<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="global.html">AsyncFunction</a>}</span></h4>



Expand Down Expand Up @@ -9622,9 +9623,9 @@ <h5>Returns:</h5>

<div class="param-desc">
<ul>
<li>If only the first argument is provided, it will return
a function which lets you pass in the arguments as if it were a single
function call.</li>
<li>A function, that when called, is the result of
appling the <code>args</code> to the list of functions. It takes no args, other than
a callback.</li>
</ul>
</div>

Expand All @@ -9636,7 +9637,7 @@ <h5>Returns:</h5>
</dt>
<dd>

<span class="param-type">function</span>
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


</dd>
Expand Down
27 changes: 14 additions & 13 deletions docs/v3/module-ControlFlow.html
Expand Up @@ -188,7 +188,7 @@ <h3 class="subsection-title">Methods</h3>



<h4 class="name" id="applyEach"><span class="type-signature">(static) </span>applyEach<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>
<h4 class="name" id="applyEach"><span class="type-signature">(static) </span>applyEach<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="global.html">AsyncFunction</a>}</span></h4>



Expand Down Expand Up @@ -331,10 +331,9 @@ <h5>Returns:</h5>

<div class="param-desc">
<ul>
<li>If only the first argument, <code>fns</code>, is provided, it will
return a function which lets you pass in the arguments as if it were a single
function call. The signature is <code>(..args, callback)</code>. If invoked with any
arguments, <code>callback</code> is required.</li>
<li>Returns a function that takes no args other than
an optional callback, that is the result of applying the <code>args</code> to each
of the functions.</li>
</ul>
</div>

Expand All @@ -346,7 +345,7 @@ <h5>Returns:</h5>
</dt>
<dd>

<span class="param-type">function</span>
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


</dd>
Expand All @@ -357,15 +356,17 @@ <h5>Returns:</h5>

<h5>Example</h5>

<pre class="prettyprint"><code>async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;, (err, results) =&gt; {
<pre class="prettyprint"><code>const appliedFn = async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;)

appliedFn((err, results) =&gt; {
// results[0] is the results for `enableSearch`
// results[1] is the results for `updateSchema`
});

// partial application example:
async.each(
buckets,
async.applyEach([enableSearch, updateSchema]),
async (bucket) =&gt; async.applyEach([enableSearch, updateSchema], bucket)(),
callback
);</code></pre>

Expand Down Expand Up @@ -430,7 +431,7 @@ <h5>Example</h5>



<h4 class="name" id="applyEachSeries"><span class="type-signature">(static) </span>applyEachSeries<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>
<h4 class="name" id="applyEachSeries"><span class="type-signature">(static) </span>applyEachSeries<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="global.html">AsyncFunction</a>}</span></h4>



Expand Down Expand Up @@ -567,9 +568,9 @@ <h5>Returns:</h5>

<div class="param-desc">
<ul>
<li>If only the first argument is provided, it will return
a function which lets you pass in the arguments as if it were a single
function call.</li>
<li>A function, that when called, is the result of
appling the <code>args</code> to the list of functions. It takes no args, other than
a callback.</li>
</ul>
</div>

Expand All @@ -581,7 +582,7 @@ <h5>Returns:</h5>
</dt>
<dd>

<span class="param-type">function</span>
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


</dd>
Expand Down
13 changes: 7 additions & 6 deletions lib/applyEach.js
Expand Up @@ -21,21 +21,22 @@ import map from './map';
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {Function} - If only the first argument, `fns`, is provided, it will
* return a function which lets you pass in the arguments as if it were a single
* function call. The signature is `(..args, callback)`. If invoked with any
* arguments, `callback` is required.
* @returns {AsyncFunction} - Returns a function that takes no args other than
* an optional callback, that is the result of applying the `args` to each
* of the functions.
* @example
*
* async.applyEach([enableSearch, updateSchema], 'bucket', (err, results) => {
* const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')
*
* appliedFn((err, results) => {
* // results[0] is the results for `enableSearch`
* // results[1] is the results for `updateSchema`
* });
*
* // partial application example:
* async.each(
* buckets,
* async.applyEach([enableSearch, updateSchema]),
* async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),
* callback
* );
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/applyEachSeries.js
Expand Up @@ -16,8 +16,8 @@ import mapSeries from './mapSeries';
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {Function} - If only the first argument is provided, it will return
* a function which lets you pass in the arguments as if it were a single
* function call.
* @returns {AsyncFunction} - A function, that when called, is the result of
* appling the `args` to the list of functions. It takes no args, other than
* a callback.
*/
export default applyEach(mapSeries);

0 comments on commit 028e1e6

Please sign in to comment.