Sha256: 54db4501c067e6e0b8342527e9fdea221434330481728904e71db99f390bc54a

Contents?: true

Size: 1.52 KB

Versions: 48

Compression:

Stored size: 1.52 KB

Contents

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function () /*...args*/{
  return _seq2.default.apply(null, (0, _slice2.default)(arguments).reverse());
};

var _seq = require('./seq');

var _seq2 = _interopRequireDefault(_seq);

var _slice = require('./internal/slice');

var _slice2 = _interopRequireDefault(_slice);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

;

/**
 * Creates a function which is a composition of the passed asynchronous
 * functions. Each function consumes the return value of the function that
 * follows. Composing functions `f()`, `g()`, and `h()` would produce the result
 * of `f(g(h()))`, only this version uses callbacks to obtain the return values.
 *
 * Each function is executed with the `this` binding of the composed function.
 *
 * @name compose
 * @static
 * @memberOf module:ControlFlow
 * @method
 * @category Control Flow
 * @param {...AsyncFunction} functions - the asynchronous functions to compose
 * @returns {Function} an asynchronous function that is the composed
 * asynchronous `functions`
 * @example
 *
 * function add1(n, callback) {
 *     setTimeout(function () {
 *         callback(null, n + 1);
 *     }, 10);
 * }
 *
 * function mul3(n, callback) {
 *     setTimeout(function () {
 *         callback(null, n * 3);
 *     }, 10);
 * }
 *
 * var add1mul3 = async.compose(mul3, add1);
 * add1mul3(4, function (err, result) {
 *     // result now equals 15
 * });
 */
module.exports = exports['default'];

Version data entries

48 entries across 46 versions & 11 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/async/compose.js
disco_app-0.18.0 test/dummy/node_modules/async/compose.js
disco_app-0.18.2 test/dummy/node_modules/async/compose.js
disco_app-0.16.1 test/dummy/node_modules/async/compose.js
disco_app-0.15.2 test/dummy/node_modules/async/compose.js
disco_app-0.18.4 test/dummy/node_modules/async/compose.js
disco_app-0.18.1 test/dummy/node_modules/async/compose.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/async/compose.js
disco_app-0.14.0 test/dummy/node_modules/async/compose.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/async/compose.js
tang-0.2.1 spec/tang_app/node_modules/async/compose.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/async/compose.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/async/compose.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/async/compose.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/async/compose.js
tang-0.2.0 spec/tang_app/node_modules/async/compose.js
tang-0.1.0 spec/tang_app/node_modules/async/compose.js
tang-0.0.9 spec/tang_app/node_modules/async/compose.js
enju_library-0.3.8 spec/dummy/node_modules/async/compose.js
ilog-0.4.1 node_modules/async/compose.js