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

    Returns the fallback if x is null or undefined.

    Type Parameters

    • E

    Parameters

    • fallback: E

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

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

        • A

        • B

        • C

        • D

        Parameters

        Returns ((x) => E)

          • (x): E
          • Parameters

            • x: A

            Returns E

    See

    pipe2, pipe3

    Example

    pipe4('fallback')([x => x / 2, y => y.toString(), z => [z, z], w => w.join('/')])(42)
    // => "21/21"

    pipe4('fallback')([x => x / 2, y => y.toString(), z => [z, z], w => w.join('/')])(undefined)
    // => "fallback"

Generated using TypeDoc