flow.js 617 B

12345678910111213141516171819202122232425
  1. var createFlow = require('../internal/createFlow');
  2. /**
  3. * Creates a function that returns the result of invoking the provided
  4. * functions with the `this` binding of the created function, where each
  5. * successive invocation is supplied the return value of the previous.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @category Function
  10. * @param {...Function} [funcs] Functions to invoke.
  11. * @returns {Function} Returns the new function.
  12. * @example
  13. *
  14. * function square(n) {
  15. * return n * n;
  16. * }
  17. *
  18. * var addSquare = _.flow(_.add, square);
  19. * addSquare(1, 2);
  20. * // => 9
  21. */
  22. var flow = createFlow();
  23. module.exports = flow;