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(throttle): add reset method to ThrottleFunction #136

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Jul 23, 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

Adds a reset method that allows a throttled function's next call to happen immediately. It also prevents a trailing call from happening, if one was pending.

For any code change,

  • 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

Bundle impact

Status File Size Difference (%)
M src/curry/throttle.ts 299 1 +37 (+14%)

Footnotes

  1. Function size includes the import dependencies of the function.

@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Jul 29, 2024
@aleclarson aleclarson added the stage 0: proposed A proposal for a change that is offered for community and team evaluation. label Sep 21, 2024
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 stage 0: proposed A proposal for a change that is offered for community and team evaluation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant