emitAll

@ExperimentalCoroutinesApi suspend fun <T> FlowCollector<T>.emitAll(
    channel: ReceiveChannel<T>
): Unit
(source)

Emits all elements from the given channel to this flow collector and cancels (consumes) the channel afterwards. If you need to iterate over the channel without consuming it, a regular for loop should be used instead.

This function provides a more efficient shorthand for channel.consumeEach { value -> emit(value) }. See consumeEach.

@ExperimentalCoroutinesApi inline suspend fun <T> FlowCollector<T>.emitAll(
    flow: Flow<T>
): Unit
(source)

Collects all the values from the given flow and emits them to the collector. It is a shorthand for flow.collect { value -> emit(value) }.