Co Guest State
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
| Property | Type | Role | Description |
| connected | StateFlow<List<SeatUserInfo>> | Both | List of users currently on seats |
| invitees | StateFlow<List<LiveUserInfo>> | Host | Users invited by host (waiting for response) |
| applicants | StateFlow<List<LiveUserInfo>> | Host | Users who applied (waiting for host decision) |
| candidates | StateFlow<List<LiveUserInfo>> | Host | List 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)
}
}
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(connected: StateFlow<List<SeatUserInfo>>, invitees: StateFlow<List<LiveUserInfo>>, applicants: StateFlow<List<LiveUserInfo>>, candidates: StateFlow<List<LiveUserInfo>>)