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.

26 lines
590 B

4 years ago
  1. var createFlow = require('./_createFlow');
  2. /**
  3. * This method is like `_.flow` except that it creates a function that
  4. * invokes the given functions from right to left.
  5. *
  6. * @static
  7. * @since 3.0.0
  8. * @memberOf _
  9. * @category Util
  10. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  11. * @returns {Function} Returns the new composite function.
  12. * @see _.flow
  13. * @example
  14. *
  15. * function square(n) {
  16. * return n * n;
  17. * }
  18. *
  19. * var addSquare = _.flowRight([square, _.add]);
  20. * addSquare(1, 2);
  21. * // => 9
  22. */
  23. var flowRight = createFlow(true);
  24. module.exports = flowRight;