toEventSource

fun <E> Flow<E>.toEventSource(scope: CoroutineScope): EventSource<E>

Create an EventSource that emits each E from this Flow.

Collection of the flow will be launched in scope when EventSource.subscribe is called and the job cancelled when on Disposable.dispose.