conditionalDelay

@ExperimentalCoroutinesApi
fun <T> Flow<T>.conditionalDelay(shouldDelay: (value: T) -> Boolean, timeMillis: Long): Flow<T>

The function delays emitting if we need to pause when changing values.

Parameters

shouldDelay
  • Apply delay for the value if result is true

timeMillis
  • Delay after which the value for will be emitted