3 Object.defineProperty(exports, "__esModule", {
7 var _seq = require('./seq');
9 var _seq2 = _interopRequireDefault(_seq);
11 var _rest = require('./internal/rest');
13 var _rest2 = _interopRequireDefault(_rest);
15 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 * Creates a function which is a composition of the passed asynchronous
19 * functions. Each function consumes the return value of the function that
20 * follows. Composing functions `f()`, `g()`, and `h()` would produce the result
21 * of `f(g(h()))`, only this version uses callbacks to obtain the return values.
23 * Each function is executed with the `this` binding of the composed function.
27 * @memberOf module:ControlFlow
29 * @category Control Flow
30 * @param {...Function} functions - the asynchronous functions to compose
31 * @returns {Function} an asynchronous function that is the composed
32 * asynchronous `functions`
35 * function add1(n, callback) {
36 * setTimeout(function () {
37 * callback(null, n + 1);
41 * function mul3(n, callback) {
42 * setTimeout(function () {
43 * callback(null, n * 3);
47 * var add1mul3 = async.compose(mul3, add1);
48 * add1mul3(4, function (err, result) {
49 * // result now equals 15
52 exports.default = (0, _rest2.default)(function (args) {
53 return _seq2.default.apply(null, args.reverse());
55 module.exports = exports['default'];