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

    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

    compose2, compose3

    Example

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

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

Generated using TypeDoc