-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The current rising edge (immediate in the below diagram) will potentially lose the last few debounced listener calls, for a duration up to the set debounce time.
This is contrary to the current falling impl. (queuedIdle in the below diagram), which will ensure the very last time the debounced function is called, that call will be passed along to the listener to ensure the last call contains the newest data. But it may never be called if the events are too frequent.
To fix both these problems, a third edge type (queuedImmediate) should be introduced.
In the end it could look something like this:
Edit:
Disregard the things above, I changed the implementation again to simplify it and still cover just about any use case. Refer to the docs for the up to date info.
