createPresence
function createPresence(name, options?): Presence;Tracks the other tabs/windows/workers on this bus. Any message from a peer counts as a liveness signal (state patches, events, and presence pings all piggyback); an explicit ‘bye’ removes them at once.
Silence, though, is not proof of death — and treating it that way is what made the roster flap. Browsers clamp a hidden tab’s timers to roughly one tick a minute, so a perfectly healthy backgrounded peer stops heartbeating, gets pruned, pings once, is re-added, and disappears again: a peer count oscillating once a minute for no reason. Waking a laptop does it to every peer at once.
What saves it is that message handlers are not throttled — only timers are. A hidden tab still answers a hello the instant it arrives. So a peer that goes quiet is probed rather than dropped, and only silence that survives the probe counts as gone.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | string |
options? | PresenceOptions |