Documentation - v7.17.0
    Preparing search index...

    Function isEventSupported

    • Checks whether eventTarget accepts listeners for eventName, by adding and immediately removing a no-op listener.

      Some targets (e.g. mock objects, or restricted environments) throw when a listener is added; this lets callers feature-detect instead of failing.

      Type Parameters

      Parameters

      • eventTarget: Target | undefined

        The target to test. undefined is accepted and reported as unsupported.

      • eventName: EventName

        The event name to test.

      Returns boolean

      true if a listener could be added, false otherwise.