asStateFlow

abstract fun asStateFlow(): StateFlow<IC>

Returns the collection's content as a StateFlow of an immutable collection IC type.

The flow emits a new immutable snapshot of the collection whenever a change occurs. Observers can collect this flow to react to data modifications.

Return

A StateFlow that emits the latest immutable state of the collection.