The fetch client instance to use
The URL to connect to
Optional
handshakeCallback: (msg: HandshakeMessage) => voidA function which is called on succeeded or failed handshake
Allows to listen to Cometd connection to e.g. detect when connection was lost.
Allows to listen to Cometd handshake to find out if e.g. the connection was reestablished.
Disconnects the current connection.
Returns true if the CometD instance is disconnected or disconnecting.
Removes the subscription obtained with a call to addHandshakeListener
or addConnectListener
.
Resubscribes as necessary in case of a re-handshake.
Subscribes to a realtime channel to listen for data.
The channel to connect to
A function to call when data is received
Cancels the listening to a channel.
The subscription object returned by subscribe()
Allows to set up a realtime (websocket or long-polling) connection to the platform.