CoGuestState

data class CoGuestState(val connected: StateFlow<List<SeatUserInfo>>, val invitees: StateFlow<List<LiveUserInfo>>, val applicants: StateFlow<List<LiveUserInfo>>, val candidates: StateFlow<List<LiveUserInfo>>)

Co-guest related state data provided externally by CoGuestStore

Overview

A comprehensive snapshot of the current co-guest session state. This structure contains all relevant information about connected users, pending invitations and applications.

State Properties Overview

PropertyTypeRoleDescription
connectedStateFlow<List<SeatUserInfo>>BothList of users currently on seats
inviteesStateFlow<List<LiveUserInfo>>HostUsers invited by host (waiting for response)
applicantsStateFlow<List<LiveUserInfo>>HostUsers who applied (waiting for host decision)
candidatesStateFlow<List<LiveUserInfo>>HostList of potential users available for invitation (not yet implemented)

Tip: State is automatically updated when users join/leave seats, send/cancel invitations, or apply/cancel applications. Subscribe to coGuestState to receive real-time updates.

Usage Example

// Connected users subscription
lifecycleScope.launch {
store.coGuestState.connected.collect { connected ->
updateConnectedUsersUI(connected)
}
}

// Pending applications subscription (host only)
lifecycleScope.launch {
store.coGuestState.applicants.collect { applicants ->
if (applicants.isNotEmpty()) {
showApplicationsBadge(applicants.size)
}
}
}

// Pending invitations subscription (host only)
lifecycleScope.launch {
store.coGuestState.invitees.collect { invitees ->
if (invitees.isNotEmpty()) {
showInvitationsPendingUI(invitees)
}
}
}

Constructors

Link copied to clipboard
constructor(connected: StateFlow<List<SeatUserInfo>>, invitees: StateFlow<List<LiveUserInfo>>, applicants: StateFlow<List<LiveUserInfo>>, candidates: StateFlow<List<LiveUserInfo>>)

Properties

Link copied to clipboard
val applicants: StateFlow<List<LiveUserInfo>>

List of users who applied for co-guest received by host.

Link copied to clipboard
val candidates: StateFlow<List<LiveUserInfo>>

List of candidate users for co-guest.

Link copied to clipboard
val connected: StateFlow<List<SeatUserInfo>>

List of users already on seats.

Link copied to clipboard
val invitees: StateFlow<List<LiveUserInfo>>

List of users invited by host.