flowRight source npm

_.flowRight([funcs])

This method is like _.flow except that it creates a function that invokes the provided functions from right to left.

Arguments

  1. [funcs] (...(Function|Function[])

    Functions to invoke.

Returns (Function)

Returns the new function.

Example

function square(n) {
  return n * n;
}

var addSquare = _.flowRight(square, _.add);
addSquare(1, 2);
// => 9