API Reference

throttle-debounce

Throttle or debounce functions in one small package with edge options.

Official Documentation ↗
CompatibilityThis documentation covers version v5.0.2. Check the official docs for the latest API surface.

Installation

npmnpm install throttle-debounce
pnpmpnpm add throttle-debounce

Methods

throttle-debounce is throttle or debounce functions in one small package with edge options.

Key Features

  • resilience: Designed for resilience scenarios with a focused API surface.

Installation

npm install throttle-debounce

Usage

FAQ

What is the difference between debounce and throttle?
Debounce delays until activity stops for wait ms; throttle guarantees at most one invocation per wait window.
Does throttle-debounce support leading and trailing edges?
Yes, pass { leading: true, trailing: false } to control when the function fires.
Is throttle-debounce safe for use in React effects?
Yes, but cancel pending calls on cleanup to avoid setState after unmount.