• Transforms a function such that it only executes when condition is truthy.

    Type Parameters

    Parameters

    • fn: F

      The function to conditionally execute.

    • Optionalcondition: unknown

      The condition to check before executing fn.

    Returns ((...args: Parameters<F>) => ReturnType<F> | undefined)

    The conditionalized function with the same signature as fn.