HandleRoomState

fun HandleRoomState(states: List<Room.State> = emptyList(), passedRoom: Room? = null, vararg keys: Any, onState: suspend CoroutineScope.(Room, Room.State) -> Unit?)

A simple handler for listening to room state changes.

Parameters

states

the types of states to listen to, or empty list to listen to all state changes.

passedRoom

the room to use, or null to use RoomLocal if inside a RoomScope.

onState

the listener to be called back. Will be called immediately with the existing state if it is a matching state.

keys

any keys that should be tracked to relaunch the handler with new keys.


fun HandleRoomState(state: Room.State, passedRoom: Room? = null, vararg keys: Any, onState: suspend CoroutineScope.(Room, Room.State) -> Unit?)

See also