flowRight.js 574 B

12345678910111213141516171819202122232425
  1. var createFlow = require('../internal/createFlow');
  2. /**
  3. * This method is like `_.flow` except that it creates a function that
  4. * invokes the provided functions from right to left.
  5. *
  6. * @static
  7. * @memberOf _
  8. * @alias backflow, compose
  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 = _.flowRight(square, _.add);
  19. * addSquare(1, 2);
  20. * // => 9
  21. */
  22. var flowRight = createFlow(true);
  23. module.exports = flowRight;