Hi, I have code that goes something like this: ```...
# coroutines
m
Hi, I have code that goes something like this:
Copy code
var source = 1
flowOf(source).transform { while(true) emit(it) }
When I change
source
to a different value I want the infinite
transform { while(true) }
to get cancelled and to instead create a new infinite transform of 2 (currently it will always emit 1, which is not what I want). Is there any easy way to achieve that? Edit:
transformLatest
is what I wanted
1