events

val events: Flow<Any>(source)

One-shot UI event stream.

Events are buffered and delivered in order. Each emission is consumed once, making this suitable for side-effects such as:

  • Snackbar messages

  • Toast notifications

  • Dialog triggers

  • Navigation (via Destination)

Collect this inside KScreen or a LaunchedEffect:

LaunchedEffect(viewModel) {
viewModel.events.collect { event ->
when (event) {
is ProfileEvent.ShowToast -> { ... }
else -> Unit
}
}
}

Note: Because events are typed as Any, when expressions require an else branch. Prefer dev.kindling.compose.KViewModel (two-param) if exhaustive event handling matters for your screen.