@newdash/newdash
Version:
javascript/typescript utility library
25 lines (24 loc) • 604 B
TypeScript
/**
* Composes 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.
*
* @since 5.18.0
* @category Util
* @param funcs The functions to invoke.
* @returns Returns the new composite function.
* @see flowRight
* @example
*
* ```ts
* function square(n) {
* return n * n
* }
*
* const addSquare = flow(add, square)
* addSquare(1, 2)
* // => 9
* ```
*/
export declare function flow(...funcs: Array<Function>): Function;
export default flow;