onCollectionEvent

suspend fun <T> MutableSharedFlow<T>.onCollectionEvent(onEvent: suspend MutableSharedFlow<T>.(SharedFlowCollectionEvent) -> Unit)

Calls back with events in the following order:

FirstCollection ->NoMoreCollections ->LaterCollections -> back to NoMoreCollections when all flows are terminated

If a flow already exists on this MutableSharedFlow the FirstCollection event is immediately raised. If no subscriptions exist

Note that if this MutableSharedFlow was subscribed and unsubscribed before this method was called, a new subscription will still raise the FirstCollection event