• 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

    • R4

    Parameters

    • fallback: R4

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

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

        • T

        • R1

        • R2

        • R3

        Parameters

        Returns ((x) => R4)

          • (x): R4
          • Parameters

            • x: T

            Returns R4

    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