createBroadcastChannelTransport
The createBroadcastChannelTransport function wraps a BroadcastChannel in a BroadcastChannelTransport implementation.
createBroadcastChannelTransport(
channelName: string,
options?: TransportOptions,
): BroadcastChannelTransport| Type | Description | |
|---|---|---|
channelName | string | The name of the BroadcastChannel to use. |
options? | TransportOptions | Optional |
| returns | BroadcastChannelTransport | A |
This transport enables real-time synchronization between Synclets running in different browser contexts (tabs, windows, iframes) within the same origin. It uses the browser's BroadcastChannel API for efficient, same-origin communication without requiring a server.
The transport is only available in browser environments that support the BroadcastChannel API (all modern browsers). It provides automatic fragmentation for large packets and bidirectional communication between all contexts sharing the same channel name.
This is ideal for synchronizing state across multiple tabs or windows of the same web application without server involvement.
Since
v0.0.0