8000 Can just-debounce-it run the first and last call? · Issue #573 · angus-c/just · GitHub
[go: up one dir, main page]

Skip to content

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

Open

Description

@thebjorn

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0