Options
All
  • Public
  • Public/Protected
  • All
Menu

Module flow

Index

References

Functions Util

References

Renames and re-exports flow

Util Functions

  • flow(...funcs: Function[]): Function
  • 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

    see

    flowRight

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

    const addSquare = flow(add, square)
    addSquare(1, 2)
    // => 9

    Parameters

    • Rest ...funcs: Function[]

      The functions to invoke.

    Returns Function

    Returns the new composite function.