Skip to content

feat(feature): add throttle function to limt function calls within a … #259

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

Merged
merged 3 commits into from
Mar 2, 2025

Conversation

WizardOfDigits
Copy link
Contributor

@WizardOfDigits WizardOfDigits commented Feb 10, 2025

Description

What’s Added:

  • Added a new throttle function that limits the execution frequency of a given function.
  • The throttle function ensures that the provided function is called at most once within the specified time interval, improving performance in high-frequency event scenarios like scrolling or resizing.

Why This Addition:

This addition helps optimize performance by reducing the number of times event handlers are triggered during high-frequency events (e.g., scroll, resize), preventing unnecessary function calls and enhancing application performance.

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Additional Context

Screenshots (Optional)

Click to view screenshots

@technoph1le technoph1le merged commit ad64947 into technoph1le:main Mar 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants