Function: createWSClient()
createWSClient(
opts
):object
Parameters
Parameter | Type |
---|---|
opts | WebSocketClientOptions |
Returns
object
close()
close: () =>
void
Returns
void
connection
readonly
connection:object
&object
|object
|object
|null
connectionState
connectionState:
BehaviorSubject
reconnect()
reconnect: (
cause
) =>void
Reconnect to the WebSocket server
Parameters
Parameter | Type |
---|---|
cause | Error | null |
Returns
void
request()
request: (
opts
) =>UnsubscribeFn
Parameters
Parameter | Type |
---|---|
opts | object |
opts.callbacks | WSCallbackObserver <AnyRouter , unknown > |
opts.lastEventId | string | undefined |
opts.op | Operation |
Returns
UnsubscribeFn
See
https://trpc.io/docs/v11/client/links/wsLink
Deprecated
🙋♂️ Contributors needed to continue supporting WebSockets! See https://github.com/trpc/trpc/issues/6109
Defined in
packages/client/dist/links/wsLink.d.ts:76