Primitives / foldkit-primitives/net

postBroadcast

function · packages/primitives/src/net/broadcast.ts:77

function postBroadcast(
  name: string,
  data: unknown,
  create?: ChannelFactory | undefined,
): Command<BroadcastMessage, never, never>

Posts one message to name. Opens a channel, posts, and closes it: the send is one-shot, so it is a Command, not a resource. Without a BroadcastChannel API — or when the post throws — it yields BroadcastFailed instead of throwing.