Skip to content

Broadcast Channel

Bindings for @solid-primitives/broadcast-channel.

let makeBroadcastChannel<'T>(name: string): MakeBroadcastChannelResult<'T>
let createBroadcastChannel<'T>(name: string): CreateBroadcastChannelResult<'T>
  • makeBroadcastChannel opens a channel for cross-tab communication. Its result has onMessage, postMessage, close, channelName and instance (the underlying BroadcastChannel).
  • createBroadcastChannel returns a message signal in place of onMessage. The signal updates when another context calls postMessage.

Channels are shared by name: asking for an existing name returns that channel, and it closes when its last owner is cleaned up.

Edit this page