Transport
Defined in: transport.ts:8
A bidirectional channel that carries values of type T.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Methods
Section titled “Methods”close()
Section titled “close()”close(): void;Defined in: transport.ts:14
Permanently close this endpoint. Further sends are an error.
Returns
Section titled “Returns”void
onMessage()
Section titled “onMessage()”onMessage(handler): () => void;Defined in: transport.ts:12
Subscribe to inbound messages. Returns an unsubscribe function.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handler | (message) => void |
Returns
Section titled “Returns”() => void
send()
Section titled “send()”send(message): void;Defined in: transport.ts:10
Push a message toward the peer(s) on the other side.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message | T |
Returns
Section titled “Returns”void