The Debounce route is an intriguing idea, but I couldn't quite make it work.
First off, to recap for me and everyone else reading along: Debounce will only emit the last element of the sequence once the acquiescence period is reached.
That's why Quinn added the reduction to accumulate all events into an array, so the debounce of the sequence of ever expanding arrays will return the last array (with all values up to then) when reaching the acquiescence period (i.e. we're debouncing the array of events, not the events themselves).
Unfortunately, I think this doesn't quite work for my use case: Imagine I have no matching devices, which might look like (in the counter sequence)
for (i, delay) in zip(0..., [3, 1, 1, 3, 1, 1, 3]) {
// for (i, delay) in zip(0..., [1, 1, 3, 1, 1, 3, 1, 1, 3]) {
In this case, I would like to receive no elements and stop iteration after the 2 second "timeout". But debounce only "arms" its timer after it has received the first element from the sequence it is debouncing.
So it would work if there always it at least once element, but otherwise it will produce nothing / wait forever.