Optionaldata: unknownSynchronously invokes every listener registered for event, in registration order.
true if at least one listener was invoked, false if there were none.
The listener list is snapshotted before dispatch, so mutations made by handlers take effect only on subsequent emissions. Listeners are isolated: if one throws, the remaining listeners still run and the error is surfaced via console.error rather than swallowed silently (consistent with LocalMessageBus).
Returns the number of listeners currently registered for event.
The event name to count listeners for.
The count of registered listeners (0 if none).
Registers a listener that is invoked at most once: it is removed automatically before
being called the first time event is emitted.
This emitter, for chaining.
Remove a pending one-time listener by passing the same function reference to off.
Removes listeners for a single event, or for all events.
Optionalevent: keyof RoomEventsThe event name to clear; if omitted, listeners for every event are removed.
This emitter, for chaining.
Staticcreate
Client-side view of a single signaling room and the peers within it.
Remarks
A
Roomtracks the current peer set, their roles, and metadata, and emits events as peers join, leave, change role, or send signals/broadcasts. It also relays application-level messaging (sendSignal, broadcast) and can host a media call bound via bindCall, re-emitting remote tracks as RoomMediaEvent events. Construct via Room.create, which also returns aRoomControlfor the owner to drive lifecycle and feed server messages; theRoomitself is a read-and-subscribe surface.