Function ifDefinedThen

Executes a callback if the value is defined

  • Type Parameters

    • T

      The type of the value

    Parameters

    • callback: ((value: T) => void)

      The callback function to execute

        • (value): void
        • Parameters

          • value: T

          Returns void

    • Optionalvalue: T

      The value to check (optional)

    Returns value is T

    True if the value is defined and callback was executed, false otherwise