Is there something like `Flow.distinctUntilChanged...
# coroutines
m
Is there something like
Flow.distinctUntilChangedOrCollected()
or a simple way to implement it? Basically a value in the
Flow
should be ignored if a) it’s equal to the previous value and b) the previous value hasn’t been collected downstream yet (due to
mapLatest
being slow). If I only use
distinctUntilChanged()
then the second value would obviously be ignored independent of b).
z
Sounds like
distinctUntilChanged()
+
conflate()
?
m
@streetsofboston that does not help 😅 @Zach Klippenstein (he/him) [MOD] that wouldn’t work. As soon as
distinctUntilChanged()
is involved the second value would be lost as it’s not distinct to the previous one. I basically need
distinctUntilChanged()
forget about the previous value once it has been collected downstream. Or maybe find a way where some upstream part of the Flow can be reset downstream 🤔
s
Sorry, Marc. I didn’t read much further than your first sentence on my phone 🙂 Point b) is not addressed in my ‘answer’ 🙂
😄 1