ComPDFKit Web SDK
    Preparing search index...

    Function addEventListener

    • Subscribes to this instance's UI event bus. options.once removes the listener after the first call. VIEWER_LOADED is sticky: registering after it happened still calls back once in a microtask.

      Parameters

      • eventName: string

        The event name, from UI.Events.

      • listener: (...args: any[]) => void

        The listener.

      • Optionaloptions: { once?: boolean }

        Listener options.

        • Optionalonce?: boolean

          When true, the listener is removed after its first call.

      Returns void

      instance.UI.addEventListener(instance.UI.Events.VIEWER_LOADED, () => console.log('ready'));