BroadcastChannelTransport
Defined in: broadcast-channel.ts:25
A Transport<T> backed by a same-origin BroadcastChannel.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Implements
Section titled “Implements”Transport<T>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BroadcastChannelTransport<T>(name, options?): BroadcastChannelTransport<T>;Defined in: broadcast-channel.ts:31
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | string |
options | BroadcastChannelTransportOptions |
Returns
Section titled “Returns”BroadcastChannelTransport<T>
Methods
Section titled “Methods”close()
Section titled “close()”close(): void;Defined in: broadcast-channel.ts:51
Permanently close this endpoint. Further sends are an error.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”onMessage()
Section titled “onMessage()”onMessage(handler): () => void;Defined in: broadcast-channel.ts:46
Subscribe to inbound messages. Returns an unsubscribe function.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handler | (message) => void |
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”send()
Section titled “send()”send(message): void;Defined in: broadcast-channel.ts:41
Push a message toward the peer(s) on the other side.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message | T |
Returns
Section titled “Returns”void