is there a version of `Flow.debounce` that has a “...
# coroutines
k
is there a version of
Flow.debounce
that has a “failsafe” timeout - so that in the face of continuously emitted events at a rate faster than the debounce timeout something is at least occasionally emitted
t
Maybe the
sample
operator ? It emits at most once per period. I'm also trying to implement the
throttleLatest
operator from Rx, which is to me the best alternative to
debounce
k
hmm. that might work for my case. thanks.
it’s not exactly the same because i won’t get the first event emitted until the sample period has elapsed, which in my originally scenario would be a bit longer than the timeout
t
Then you probably need `throttleLatest`: https://github.com/ReactiveX/RxJava/wiki/Filtering-Observables#throttlelatest Notice how the first element is emitted immediately.
k
yes. doesn’t look like Flow has an equivalent right now