mibac138
12/06/2021, 12:32 PMvar 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