• 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

    • R2

    Parameters

    • fallback: R2

    Returns (<T, R1>(fns) => ((x) => R2))

      • <T, R1>(fns): ((x) => R2)
      • Type Parameters

        • T

        • R1

        Parameters

        Returns ((x) => R2)

          • (x): R2
          • Parameters

            • x: T

            Returns R2

    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