ursus
01/22/2023, 8:55 PMcombine
reemits
combine(myFlow, reEmitTrigger) { v, _ -> v)
val reEmitTrigger = MutableStateFlow(false)
reEmitTrigger.value = !reEmitTrigger.value
works but .. uglyRob
01/22/2023, 9:28 PMursus
01/22/2023, 9:30 PMmyFlow
.map { someMapper(it, clock.nowMillis() }
Rob
01/22/2023, 9:32 PMMutableStateFlow
that is updated every tick will work here?ursus
01/22/2023, 9:34 PMmyFlow
in a instant, there is some delayRob
01/22/2023, 9:37 PMursus
01/22/2023, 9:38 PMRob
01/22/2023, 9:38 PMursus
01/22/2023, 9:39 PMRob
01/22/2023, 9:41 PMRob
01/22/2023, 9:50 PMRob
01/22/2023, 10:00 PMsample
operator for kotlin flows.Rob
01/22/2023, 10:11 PMStylianos Gakis
01/22/2023, 11:45 PMI only “need” it to emit when some condition changesThen collect that “condition” changes, and at the collection do a System.currentTimeMillis() to see the time which that change happened.
thingFlow.collect { myCondition ->
val timeOfChange = System.currentTimeMillis()
// use myCondition and the time of change.
}