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
could we add leading/trailing edge options for debounce? #2380
Comments
Hi! Thanks so much for reaching out. First and foremost: I'm also happy to answer any questions you have. |
I made a start on this. It seems straightforward enough for debounce - my initial attempt at that is here (work in progress) but throttle is a little trickier. I think the current implementation of throttle would correspond to the However, I'm not sure how to approach the
...but |
Hi! You are welcome to just focus on |
This is more of a feature request than a bug. If you think this feature might make sense then maybe I will raise a PR for it.
Could we add options for debounce to configure whether the saga is called on the leading edge and/or the trailing edge? (Compare to the lodash debounce function).
This would be a very useful feature because by setting
leading: true
I can ensure I respond immediately to user actions without having to wait for the debounce period to expire.Perhaps the first
delayLength
parameter could either be number, or an options object like{ delayLength: number; leading?: boolean; trailing?: boolean }
?The text was updated successfully, but these errors were encountered: