Private binaryPrivate isPrivate isPrivate isPrivate listenersPrivate messagePrivate flushListen for an event
Unsubscribe function
The type of event to listen for
Callback to handle the event
Listen for an event
Unsubscribe function
Subscribe to room readiness changes
Unsubscribe function
const unsubscribe = room.onReady((isReady) => {
if (isReady) {
console.log('Room connected!')
} else {
console.log('Room disconnected')
}
})
// Later: unsubscribe()
Called when room becomes ready or disconnected
Subscribe to room readiness changes
Unsubscribe function
const unsubscribe = room.onReady((isReady) => {
if (isReady) {
console.log('Room connected!')
} else {
console.log('Room disconnected')
}
})
// Later: unsubscribe()
Send an event
The type of event from the registry
The event data matching the schema
Optional options: SendOptionsOptional send options (server only)
Messages are automatically queued if the room is not ready and sent once connected.
Remove all listeners for a specific event type