You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
666 B

4 years ago
  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;