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

Can just-debounce-it run the first and last call? #573

Open
thebjorn opened this issue Jan 13, 2024 · 0 comments
Open

Can just-debounce-it run the first and last call? #573

thebjorn opened this issue Jan 13, 2024 · 0 comments

Comments

@thebjorn
Copy link

If I call debounce like this:

let i = 1;
const logValue = debounce(() => console.log(i++), 500, true);
logValue();
logValue();
logValue();

it prints 1 and 2. Is there any way to make it print 1 and 3?

I'd like to use it for auto-saving editor updates, so the last call is important.

I couldn't see a way of accomplishing it from the docs. If it's not currently possible, is it something you would consider implementing?

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