flow

Util
since 3.0.0

Arguments

  • ...(Function|Function[]) The functions to invoke.

Returns

Function the new composite function.

Creates a function that returns the result of invoking the given functions with the this binding of the created function, where each successive invocation is supplied the return value of the previous.

Example of Lodash _.flow

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

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