filterLimit.js

  1. import filter from './internal/filter';
  2. import doParallelLimit from './internal/doParallelLimit';
  3. /**
  4. * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
  5. * time.
  6. *
  7. * @name filterLimit
  8. * @static
  9. * @memberOf module:Collections
  10. * @method
  11. * @see [async.filter]{@link module:Collections.filter}
  12. * @alias selectLimit
  13. * @category Collection
  14. * @param {Array|Iterable|Object} coll - A collection to iterate over.
  15. * @param {number} limit - The maximum number of async operations at a time.
  16. * @param {Function} iteratee - A truth test to apply to each item in `coll`.
  17. * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
  18. * with a boolean argument once it has completed. Invoked with (item, callback).
  19. * @param {Function} [callback] - A callback which is called after all the
  20. * `iteratee` functions have finished. Invoked with (err, results).
  21. */
  22. export default doParallelLimit(filter);