eachSeries.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _eachLimit = require('./eachLimit');
  6. var _eachLimit2 = _interopRequireDefault(_eachLimit);
  7. var _doLimit = require('./internal/doLimit');
  8. var _doLimit2 = _interopRequireDefault(_doLimit);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. /**
  11. * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
  12. *
  13. * @name eachSeries
  14. * @static
  15. * @memberOf module:Collections
  16. * @method
  17. * @see [async.each]{@link module:Collections.each}
  18. * @alias forEachSeries
  19. * @category Collection
  20. * @param {Array|Iterable|Object} coll - A collection to iterate over.
  21. * @param {Function} iteratee - A function to apply to each
  22. * item in `coll`. The iteratee is passed a `callback(err)` which must be called
  23. * once it has completed. If no error has occurred, the `callback` should be run
  24. * without arguments or with an explicit `null` argument. The array index is
  25. * not passed to the iteratee. Invoked with (item, callback). If you need the
  26. * index, use `eachOfSeries`.
  27. * @param {Function} [callback] - A callback which is called when all
  28. * `iteratee` functions have finished, or an error occurs. Invoked with (err).
  29. */
  30. exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);
  31. module.exports = exports['default'];