ribesg
09/17/2021, 11:26 AMJoffrey
09/17/2021, 2:21 PMMichal Klimczak
09/17/2021, 3:21 PMval trigger = MutableSharedFlow<Sth>()
val flow = trigger.
.flatMapLatest {
if(it!=null)
while(true){
emit(it)
delay(1000)
}
}
}
ephemient
09/17/2021, 4:21 PMtrigger.transformLatest { item ->
emit(item)
if (item != null) {
delay(Duration.seconds(1))
emit(item)
}
}
the mention of "state flow" is confusing, though. a state flow conflates equals values; if you want something that re-emits the same value, it can't be a StateFlow.Joffrey
09/17/2021, 4:22 PMMichal Klimczak
09/17/2021, 4:25 PMandylamax
09/18/2021, 3:04 AMlouiscad
09/18/2021, 9:56 AMtransformLatest
.ribesg
09/20/2021, 8:57 AM