pavlospt
10/23/2020, 11:35 AMHello 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:
fun calculateX(): Flow<X> = flow { emit(something) }.combineTransform(coldFlowB.catch { emit(X) }) { x, x -> emit(X) }