1 | var Config = require('./config');
|
2 | var makeAsyncFunc = require('./makeAsyncFunc');
|
3 | /**
|
4 | * Creates a suspendable function. Suspendable functions may use the await() function
|
5 | * internally to suspend execution at arbitrary points, pending the results of
|
6 | * internal asynchronous operations.
|
7 | * @param {Function} fn - Contains the body of the suspendable function. Calls to await()
|
8 | * may appear inside this function.
|
9 | * @returns {Function} A function of the form `(...args) --> Promise`. Any arguments
|
10 | * passed to this function are passed through to fn. The returned
|
11 | * promise is resolved when fn returns, or rejected if fn throws.
|
12 | */
|
13 | var async = makeAsyncFunc(new Config());
|
14 | async.cps = async.mod('returns: none, callback: true, iterable: false');
|
15 | async.thunk = async.mod('returns: thunk, callback: false, iterable: false');
|
16 | async.result = async.mod('returns: result, callback: false, iterable: false');
|
17 | async.iterable = async.mod('returns: promise, callback: false, iterable: true');
|
18 | module.exports = async;
|
19 | //# sourceMappingURL=index.js.map |
\ | No newline at end of file |