Function applyTo

  • Takes a value and applies a function to it.

    Example

    const applyTo10 = applyTo(10);

    applyTo10((value: number) => value * 2); // 20
    applyTo10((value: number) => value / 2); // 5

    Returns

    Function that expects a function that will receive the input.

    Type Parameters

    • Input

    Parameters

    • input: Input

    Returns (<Output>(unary: Unary<Input, Output>) => Output)

      • <Output>(unary: Unary<Input, Output>): Output
      • Type Parameters

        • Output

        Parameters

        • unary: Unary<Input, Output>

        Returns Output