throttleFirst

fun <T> Flow<T>.throttleFirst(window: Duration): Flow<T>

Emits the first value, then drops every value that arrives within window of the last emission.

The window opens again once window has elapsed after an emitted value; the next value to arrive is emitted and starts a new window. Dropped values are lost, not conflated. Cancellation of the collector cancels the upstream and the internal timer.

Throws

if window is not positive.