10/23/2020, 11:35 AM
x-post from another Slack group if someone could help figure out this 🙂
Hello friends, I am kind of struggling to find if it is possible to turn a cold Kotlin flow into a hot one. My usecase is that I have a flow which I want to combine with another one, but if flow B completes, then the combine operator stops working due to the completion of one of the flows. Is there away to force the cold flow to re-emit always when the function is trigger? Attaching an example below:
Copy code
fun calculateX(): Flow<X> = flow { emit(something) }.combineTransform(coldFlowB.catch { emit(X) }) { x, x -> emit(X) }