Companion

object Companion

Functions

Link copied to clipboard
fun filter(presence: PresenceState, predicate: (Map.Entry<String, PresenceMap>) -> Boolean?): PresenceState
Link copied to clipboard
fun <T> listBy(presence: PresenceState, transform: (Map.Entry<String, PresenceMap>) -> T): List<T>
Link copied to clipboard
fun syncDiff(currentState: PresenceState, diff: PresenceDiff, onJoin: OnJoin = { _, _, _ -> }, onLeave: OnLeave = { _, _, _ -> }): PresenceState

Used to sync a diff of presence join and leave events from the server, as they happen. Like syncState, syncDiff accepts optional onJoin and onLeave callbacks to react to a user joining or leaving from a device.

Link copied to clipboard
fun syncState(currentState: PresenceState, newState: PresenceState, onJoin: OnJoin = { _, _, _ -> }, onLeave: OnLeave = { _, _, _ -> }): PresenceState

Used to sync the list of presences on the server with the client's state. An optional onJoin and onLeave callback can be provided to react to changes in the client's local presences across disconnects and reconnects with the server.