is there an equivalent to `flowOn` that takes a `C...
# flow
e
is there an equivalent to
flowOn
that takes a
CoroutineScope
? i basically want a way to have a
flow { }
block that runs inside an existing scope
feels like something that should be possible, i’m probably just not thinking of some super obvious way to do this
tried just passing
Scope.coroutineContext
but that crashes with
Flow context cannot contain job in it
e
flow
is cold. It should not be defined in the existing scope. But you can collect it in a scope that you have.
e
right, i want to collect it on the main thread but run the computation in the
flow { }
block on a background thread
i guess i can just pass in the dispatcher to
flowOn
but i was trying not to deal with that because Dispatchers.IO isn’t in KMP