Socket
Socket
Sign inDemoInstall

throttleit

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

throttleit

Throttle a function


Version published
Weekly downloads
4.7M
decreased by-16.8%
Maintainers
2
Weekly downloads
 
Created

What is throttleit?

The throttleit package is a utility that allows you to throttle a function, meaning it limits the rate at which a function can fire. This is particularly useful for handling repetitive events that you want to control, such as window resizing, scrolling, or keypresses in a performant way.

What are throttleit's main functionalities?

Throttling function calls

This code sample demonstrates how to use throttleit to throttle a window resize event handler. The onResize function will not be called more than once every 200 milliseconds, no matter how often the resize event fires.

const throttle = require('throttleit');

function onResize(event) {
  console.log('Window resized.');
}

window.addEventListener('resize', throttle(onResize, 200));

Other packages similar to throttleit

FAQs

Package last updated on 26 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc