API Reference
debounce
Debounce a function with a configurable wait and optional immediate leading call.
Official Documentation ↗CompatibilityThis documentation covers version
v2.1.0. Check the official docs for the latest API surface.Installation
npm
npm install debouncepnpm
pnpm add debounceMethods
No methods match this filter.
debounce is debounce a function with a configurable wait and optional immediate leading call.
Key Features
- resilience: Designed for resilience scenarios with a focused API surface.
Installation
npm install debounce
Usage
API reference evidence
Fetched from official sources on 2026-11-08T18:27:00+08:00 via WebFetch https://cdn.jsdelivr.net/gh/sindresorhus/debounce@latest/readme.md.
debounce.debounce→ signature from https://cdn.jsdelivr.net/gh/sindresorhus/debounce@latest/readme.md; official text: “### debounce(fn, wait, options?)”
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 debounce support leading and trailing edges?
- Yes, pass { leading: true, trailing: false } to control when the function fires.
- Is debounce safe for use in React effects?
- Yes, but cancel pending calls on cleanup to avoid setState after unmount.
Report a problem with this API docOpens a pre-filled issue on GitHub.