Skip to content

Commit 94a8b2d

Browse files
committed
use the AsyncFunction type in all docs 😓
1 parent faf395c commit 94a8b2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+237
-248
lines changed

lib/applyEach.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import map from './map';
1313
* @memberOf module:ControlFlow
1414
* @method
1515
* @category Control Flow
16-
* @param {Array|Iterable|Object} fns - A collection of asynchronous functions
16+
* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
1717
* to all call with the same arguments
1818
* @param {...*} [args] - any number of separate arguments to pass to the
1919
* function.

lib/applyEachSeries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import mapSeries from './mapSeries';
1010
* @method
1111
* @see [async.applyEach]{@link module:ControlFlow.applyEach}
1212
* @category Control Flow
13-
* @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all
13+
* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
1414
* call with the same arguments
1515
* @param {...*} [args] - any number of separate arguments to pass to the
1616
* function.

lib/asyncify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import initialParams from './internal/initialParams';
2020
* @method
2121
* @alias wrapSync
2222
* @category Util
23-
* @param {Function} func - The synchronous function to convert to an
24-
* asynchronous function.
25-
* @returns {Function} An asynchronous wrapper of the `func`. To be invoked with
26-
* (callback).
23+
* @param {Function} func - The synchronous funuction, or Promise-returning
24+
* function to convert to an {@link AsyncFunction}.
25+
* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
26+
* invoked with `(args..., callback)`.
2727
* @example
2828
*
2929
* // passing a regular synchronous function

lib/auto.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import onlyOnce from './internal/onlyOnce';
1111
import wrapAsync from './internal/wrapAsync';
1212

1313
/**
14-
* Determines the best order for running the functions in `tasks`, based on
14+
* Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
1515
* their requirements. Each function can optionally depend on other functions
1616
* being completed first, and each function is run as soon as its requirements
1717
* are satisfied.
1818
*
19-
* If any of the functions pass an error to their callback, the `auto` sequence
19+
* If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
2020
* will stop. Further tasks will not execute (so any other functions depending
2121
* on it will not run), and the main `callback` is immediately called with the
2222
* error.
2323
*
24-
* Functions also receive an object containing the results of functions which
24+
* {@link AsyncFunction}s also receive an object containing the results of functions which
2525
* have completed so far as the first argument, if they have dependencies. If a
2626
* task function has no dependencies, it will only be passed a callback.
2727
*
@@ -31,7 +31,7 @@ import wrapAsync from './internal/wrapAsync';
3131
* @method
3232
* @category Control Flow
3333
* @param {Object} tasks - An object. Each of its properties is either a
34-
* function or an array of requirements, with the function itself the last item
34+
* function or an array of requirements, with the {@link AsyncFunction} itself the last item
3535
* in the array. The object's key of a property serves as the name of the task
3636
* defined by that property, i.e. can be used when specifying requirements for
3737
* other tasks. The function receives one or two arguments:

lib/autoInject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function parseParams(func) {
4040
* @method
4141
* @see [async.auto]{@link module:ControlFlow.auto}
4242
* @category Control Flow
43-
* @param {Object} tasks - An object, each of whose properties is a function of
43+
* @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
4444
* the form 'func([dependencies...], callback). The object's key of a property
4545
* serves as the name of the task defined by that property, i.e. can be used
4646
* when specifying requirements for other tasks.

lib/cargo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ import queue from './internal/queue';
4848
* @method
4949
* @see [async.queue]{@link module:ControlFlow.queue}
5050
* @category Control Flow
51-
* @param {Function} worker - An asynchronous function for processing an array
52-
* of queued tasks, which must call its `callback(err)` argument when finished,
53-
* with an optional `err` argument. Invoked with `(tasks, callback)`.
51+
* @param {AsyncFunction} worker - An asynchronous function for processing an array
52+
* of queued tasks. Invoked with `(tasks, callback)`.
5453
* @param {number} [payload=Infinity] - An optional `integer` for determining
5554
* how many tasks should be processed per round; if omitted, the default is
5655
* unlimited.

lib/compose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import rest from './internal/rest';
1414
* @memberOf module:ControlFlow
1515
* @method
1616
* @category Control Flow
17-
* @param {...Function} functions - the asynchronous functions to compose
17+
* @param {...AsyncFunction} functions - the asynchronous functions to compose
1818
* @returns {Function} an asynchronous function that is the composed
1919
* asynchronous `functions`
2020
* @example

lib/concat.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import doParallel from './internal/doParallel';
1414
* @method
1515
* @category Collection
1616
* @param {Array|Iterable|Object} coll - A collection to iterate over.
17-
* @param {Function} iteratee - A function to apply to each item in `coll`.
18-
* The iteratee is passed a `callback(err, results)` which must be called once
19-
* it has completed with an error (which can be `null`) and an array of results.
20-
* Invoked with (item, callback).
17+
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
18+
* which should use an array as its result. Invoked with (item, callback).
2119
* @param {Function} [callback(err)] - A callback which is called after all the
2220
* `iteratee` functions have finished, or an error occurs. Results is an array
2321
* containing the concatenated results of the `iteratee` function. Invoked with

lib/concatSeries.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import doSeries from './internal/doSeries';
1111
* @see [async.concat]{@link module:Collections.concat}
1212
* @category Collection
1313
* @param {Array|Iterable|Object} coll - A collection to iterate over.
14-
* @param {Function} iteratee - A function to apply to each item in `coll`.
15-
* The iteratee is passed a `callback(err, results)` which must be called once
16-
* it has completed with an error (which can be `null`) and an array of results.
14+
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.
15+
* The iteratee should complete with an array an array of results.
1716
* Invoked with (item, callback).
1817
* @param {Function} [callback(err)] - A callback which is called after all the
1918
* `iteratee` functions have finished, or an error occurs. Results is an array

lib/constant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import initialParams from './internal/initialParams';
1313
* @category Util
1414
* @param {...*} arguments... - Any number of arguments to automatically invoke
1515
* callback with.
16-
* @returns {Function} Returns a function that when invoked, automatically
16+
* @returns {AsyncFunction} Returns a function that when invoked, automatically
1717
* invokes the callback with the previous given arguments.
1818
* @example
1919
*

0 commit comments

Comments
 (0)