sharedFlow

inline fun <T> sharedFlow(replay: Int = 0, context: CoroutineContext = EmptyCoroutineContext, crossinline observer: suspend ProducerScope<T>.() -> Unit): SharedFlow<T>

Creates a computed SharedFlow without requiring a CoroutineScope (unlike shareIn).

The observer block is only executed while there is at least one collector. When nobody collects, this is safe for garbage collection.