Function flowRight

  • This method is like flow except that it composes a function that invokes the given functions from right to left.

    Parameters

    • Rest ...funcs: Function[]

      The functions to invoke.

      Rest

    Returns Function

    Returns the new composite function.

    Since

    5.18.0

    See

    flow

    Example

    function square(n) {
    return n * n
    }

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