toChannel

suspend fun <T> Flow<T>.toChannel(channel: Channel<T>)

This function collects the items emitted by the Flow and sends each one to the given channel.

Parameters

channel

The channel to which the items should be sent.