kotlin-flow-extensions / hu.akarnokd.kotlin.flow / kotlinx.coroutines.flow.Flow / publish

publish

@FlowPreview fun <T, R> Flow<T>.publish(transform: suspend (Flow<T>) -> Flow<R>): Flow<R>

Shares a single collector towards the upstream source and multicasts values to any number of consumers which then can produce the output flow of values.