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

Debounce with leading called twice on single invocation #230

Closed
Truffula opened this issue Oct 17, 2024 · 3 comments · Fixed by #231
Closed

Debounce with leading called twice on single invocation #230

Truffula opened this issue Oct 17, 2024 · 3 comments · Fixed by #231

Comments

@Truffula
Copy link

If a debounced function with leading: true is called only once, the provided function is called twice on the first invocation. On subsequent invocations, it is only called once, after the timeout, since timerId isn't cleared.

@cedmax
Copy link
Owner

cedmax commented Oct 17, 2024

Would you care for creating a PR? since the nature of the project is NOT to create a drop in replacement for lodash (but to provide a learning space) I'd be leaning towards removing the leading option, to be honest

@102
Copy link
Collaborator

102 commented Oct 18, 2024

#231 doesn't seem to complicate the existing solution too much, so it probably could be used

@cedmax
Copy link
Owner

cedmax commented Oct 19, 2024

thank you both 🙂

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

Successfully merging a pull request may close this issue.

3 participants