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

feat: add leading option for debounce #128

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

crishoj
Copy link
Contributor

@crishoj crishoj commented Jul 21, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

This adds a leading option for debounce, which invokes the source function immediately on the first call to the debounced function.

Related issue, if any:

Resolves: sodiray/radash#408 (has PR: sodiray/radash#387)

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

@crishoj crishoj requested a review from aleclarson as a code owner July 21, 2024 11:53
@crishoj crishoj changed the title add leading option for debounce feat: add leading option for debounce Jul 21, 2024
@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Jul 23, 2024
@aleclarson aleclarson merged commit 942057e into radashi-org:main Aug 15, 2024
5 of 6 checks passed
Copy link

A new beta version 12.2.0-beta.6b76988 has been published to NPM. 🚀

To install:

pnpm add radashi@12.2.0-beta.6b76988

The radashi@beta tag also includes this PR.

See the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow debounce to trigger on leading (and trailing) edge
3 participants