Updated on 2026-08-14
This commit is contained in:
parent
b95730613d
commit
ff94a669da
1 changed files with 1 additions and 3 deletions
|
|
@ -25,7 +25,6 @@ import dagger.assisted.Assisted
|
|||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.*
|
||||
|
|
@ -164,8 +163,7 @@ internal interface ClickIntents {
|
|||
private const val UM_UPDATES_THROTTLE_MS = 100L
|
||||
|
||||
/** Emits the first value immediately, then at most one (latest) value per [windowMs]. */
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun <T> Flow<T>.throttleLatest(windowMs: Long): Flow<T> = conflate().transformLatest { value ->
|
||||
private fun <T> Flow<T>.throttleLatest(windowMs: Long): Flow<T> = conflate().transform { value ->
|
||||
emit(value)
|
||||
delay(windowMs)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue