Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/throttle-debounce

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/throttle-debounce

TypeScript definitions for throttle-debounce

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
152K
decreased by-62.78%
Maintainers
1
Weekly downloads
 
Created

What is @types/throttle-debounce?

@types/throttle-debounce provides TypeScript type definitions for the throttle-debounce library, which offers utility functions for throttling and debouncing function calls. These utilities are useful for controlling the rate at which a function is executed, especially in response to events like scrolling or resizing.

What are @types/throttle-debounce's main functionalities?

Throttle

The throttle function ensures that the provided function is executed at most once every specified number of milliseconds (200ms in this case). This is useful for performance optimization in scenarios like handling scroll events.

const { throttle } = require('throttle-debounce');

const throttledFunction = throttle(200, () => {
  console.log('Throttled function executed');
});

window.addEventListener('scroll', throttledFunction);

Debounce

The debounce function ensures that the provided function is executed only after a specified number of milliseconds (200ms in this case) have passed since the last time the function was invoked. This is useful for scenarios like handling resize events.

const { debounce } = require('throttle-debounce');

const debouncedFunction = debounce(200, () => {
  console.log('Debounced function executed');
});

window.addEventListener('resize', debouncedFunction);

Other packages similar to @types/throttle-debounce

FAQs

Package last updated on 05 Mar 2019

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