Constructors
constructor
- new Realtime(client, url?, handshakeCallback?): Realtime
Parameters
- client: IFetchClient
- url: string = '/notification/realtime'
Optional
handshakeCallback: any
Methods
addConnectListener
- addConnectListener(callback): SubscriptionHandle
Parameters
- callback: ((msg: Message) => void)
Returns SubscriptionHandle
addHandshakeListener
- addHandshakeListener(callback): SubscriptionHandle
Parameters
- callback: ((msg: HandshakeMessage) => void)
Returns SubscriptionHandle
disconnect
- disconnect(disconnectCallback?): void
Parameters
- disconnectCallback: Listener = undefined
Returns void
isDisconnected
- isDisconnected(): boolean
Returns boolean
removeListener
- removeListener(subscriptionHandle): void
Parameters
- subscriptionHandle: SubscriptionHandle
Returns void
resubscribe
- resubscribe(subscriptionHandle): SubscriptionHandle
Parameters
- subscriptionHandle: SubscriptionHandle
Returns SubscriptionHandle
subscribe
- subscribe(channel, callback): SubscriptionHandle
Parameters
- channel: string
- callback: Callback
Returns SubscriptionHandle
unsubscribe
- unsubscribe(subscription): void
Parameters
- subscription: SubscriptionHandle
Returns void
Allows to set up a realtime (websocket or long-polling) connection to the platform.