I am looking for an operator to debounce series of events, say, a user click. Entrance and exit should be like this:
interval : -> <- -> <- in : 1--2--3-------4--5--5--6-7-8-------- out : 1-------------4---------------------
The idea is similar to underlining with the immediate on http://underscorejs.org/#debounce option. The operator can be represented / implemented in any language that supports Reactive Extensions.
Change: specify the interval, say, 5 seconds (5 spaces between two arrows): -> <-
Edit2: a more understandable version: I have a user, he repeatedly presses the button (1, 2, 3); I want to catch the first click (1) and ignore the rest. After a while, he gets tired and rests for 7 seconds (which is more than a 5-second interval between two arrows) and I press the button again (4, 5, 6, 7, 8). I want to catch the first click (4) and ignore everything else.
If he clicks after the fourth arrow, I also want to catch this click.
Edit3: here is the image
which can be found in the original article
source share