• Subscribes to a specific event type with a callback function.

    Type Parameters

    • T = ApiCallback<string>

      The type of the callback function, defaults to ApiCallback.

    Parameters

    • eventType: string

      The name of the event to subscribe to.

    • callback: EventCallback<T>

      The callback function to execute when the event is triggered.

    Returns {
        count: number;
        unsubscribe: (() => {
            count: number;
        });
    }

    An object containing:

    • count: The number of active subscriptions for the event type.
    • unsubscribe: A function to unsubscribe from the event, which also returns the updated subscription count.
    • count: number
    • unsubscribe: (() => {
          count: number;
      })
        • (): {
              count: number;
          }
        • Returns {
              count: number;
          }

          • count: number