• Compose an array of exactly 2 functions from top to bottom (left to right).

    Returns the fallback if x is null or undefined.

    Type Parameters

    • C

    Parameters

    • fallback: C

    Returns (<A, B>(fns) => ((x) => C))

      • <A, B>(fns): ((x) => C)
      • Type Parameters

        • A

        • B

        Parameters

        Returns ((x) => C)

          • (x): C
          • Parameters

            • x: A

            Returns C

    See

    pipe3, pipe4

    Example

    pipe2('fallback')([x => x / 2, y => y.toString()])(42)
    // => "21"

    pipe2('fallback')([x => x / 2, y => y.toString()])(undefined)
    // => "fallback"

Generated using TypeDoc