Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New debounce edge types #46

Open
Sv443 opened this issue Jun 1, 2024 · 0 comments
Open

New debounce edge types #46

Sv443 opened this issue Jun 1, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Sv443
Copy link
Member

Sv443 commented Jun 1, 2024

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:

debounce_v2

@Sv443 Sv443 added the enhancement New feature or request label Jun 1, 2024
@Sv443 Sv443 self-assigned this Jun 1, 2024
@Sv443 Sv443 changed the title Add two more debounce edges Add two more debounce edge types Jun 1, 2024
@Sv443 Sv443 changed the title Add two more debounce edge types New debounce edge types Aug 13, 2024
@Sv443 Sv443 mentioned this issue Sep 16, 2024
46 tasks
@Sv443 Sv443 mentioned this issue Oct 19, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant