A custom WebSocket implementation to use instead of the one provided by the global scope. Mostly useful for when using the client outside of the browser environment.

Constructors

Methods

  • Type Parameters

    Parameters

    • event: T
    • callback: ((...args: NotifiSubscriptionEvents[T]) => void)
    • OptionalonError: ((error: unknown) => void)
        • (error): void
        • Parameters

          • error: unknown

          Returns void

    • OptionalonComplete: (() => void)
        • (): void
        • Returns void

    Returns string

    • The id of the event listener (used to remove the event listener)
  • Returns void

    Should not directly manipulate the websocket client. Instead use the returned subscription object to manage the subscription. ex. subscription.unsubscribe()

  • Type Parameters

    Parameters

    • event: T
    • id: string

    Returns void

  • Parameters

    • jwt: undefined | string

    Returns void

  • Parameters

    • jwt: undefined | string
    • subscriptionQuery: string
    • onMessageReceived: ((data: any) => undefined | void)
        • (data): undefined | void
        • Parameters

          • data: any

          Returns undefined | void

    • OptionalonError: ((data: any) => undefined | void)
        • (data): undefined | void
        • Parameters

          • data: any

          Returns undefined | void

    • OptionalonComplete: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    Returns null | Subscription

    Use addEventListener instead