Colton Idle
12/22/2024, 6:51 PM13:50:11.748 E emitting 13
13:50:11.883 E emitting 493
13:50:13.755 E dispatching 493
13:50:14.129 E emitting 493
13:50:14.272 E emitting 493
13:50:14.345 E emitting 493
13:50:14.732 E emitting 493
13:50:15.012 E emitting 493
13:50:15.211 E emitting 493
I would expect two dispatches in my logs. Code in threadColton Idle
12/22/2024, 6:51 PMviewModelScope.launch {
Log.e("LOG", "emitting ${items.flatMap { it.items }.size}")
myStateFlow.emit(items)
}
Colton Idle
12/22/2024, 6:52 PMviewModelScope.launch {
myStateFlow.debounce(2_000).collectLatest { dispatchItems(it) }
}
Colton Idle
12/22/2024, 6:53 PMfun dispatchItems(items: Set<Items<Person>>) {
Log.e("LOG", "dispatching ${items.flatMap { it.items }.size}")
...
ephemient
12/22/2024, 7:00 PMephemient
12/22/2024, 7:00 PMNote that the resulting flow does not emit anything as long as the original flow emits items faster than everymilliseconds.timeoutMillis
ephemient
12/22/2024, 7:01 PMColton Idle
12/22/2024, 7:07 PMColton Idle
12/22/2024, 7:10 PMCLOVIS
12/23/2024, 8:54 AMColton Idle
12/26/2024, 3:05 PMephemient
12/26/2024, 8:05 PMColton Idle
12/26/2024, 9:11 PM