flow.js 666 B

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