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

Cancellable throttling and debouncing #181

Open
CorvusPrudens opened this issue Oct 25, 2024 · 0 comments
Open

Cancellable throttling and debouncing #181

CorvusPrudens opened this issue Oct 25, 2024 · 0 comments

Comments

@CorvusPrudens
Copy link
Contributor

For signals and possibly functions that are throttled or debounced, it would be very useful to allow some form of cancellation.

As an example, consider a throttled search query; if the user is typing in an input element and then hits enter, what should happen? I think the natural expectation is that the query executes immediately. As they exist now, these deferred signals and functions can't easily provide this functionality.

I'm not sure cancel fully captures my thinking, here. There are really two distinct ideas:

  1. Cancel any throttled or debounced action without setting any signals or calling functions.
  2. Call the function or update the signal immediately and cancel any awaiting changes.

I'm not sure if one or both of these is important enough to be included by default, but at the very least it would be awesome to have a set of throttled/debounced functions/signals that can be cancelled!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant