use-debounce

Tiny, tree-shakeable React hooks for debouncing and throttling values and callbacks.

Library
npm
v10.1.1
3,381 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
55 /100 Fair
Development Activity 32
Maintenance 32
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 86
Code Quality 88
Innovation 90
Learning Curve 85

use-debounce is a sub-kilobyte collection of React hooks that bring debouncing and throttling to values and callbacks without ceremony. Its API is intentionally modeled on the lodash/underscore debounce and throttle functions, so the mental model transfers directly, while adapting cleanly to React’s render and effect lifecycle.

The library exposes three hooks — useDebounce for values, useDebouncedCallback for functions, and useThrottledCallback for rate-limiting — each returning control helpers such as cancel, flush, and isPending. It is fully typed, server-rendering friendly, and ships with support for maxWait, leading, and trailing edge behavior.

What You Get

  • Three focused hooks: useDebounce (values), useDebouncedCallback (functions), and useThrottledCallback (rate limiting).
  • Control helpers on every debounced function — cancel, flush, and isPending — to manage in-flight invocations.
  • Configurable timing via maxWait, leading, and trailing options, matching the lodash debounce semantics developers already know.
  • First-class TypeScript types and a tree-shakeable, sub-1 KB bundle that is safe for server-side rendering.

Common Use Cases

  • Debouncing a search input so a network request only fires after the user stops typing.
  • Throttling scroll or resize handlers to avoid excessive re-renders and layout work.
  • Flushing a pending debounced save on component unmount so unsaved changes are persisted.

Under The Hood

Architecture — The library is layered around a single core hook. useDebouncedCallback.ts holds all timing logic (timers, maxWait accounting, leading/trailing edges, and the cancel/flush/isPending control functions), memoized with useMemo and kept current across renders via refs. useDebounce.ts builds on it by storing the latest value in a ref and forcing a re-render when the debounced setter fires, while useThrottledCallback.ts is a thin wrapper that simply calls useDebouncedCallback with maxWait equal to the wait interval. index.ts re-exports the three hooks plus their shared TypeScript types, so all public surface derives from one well-tested engine.

Tech Stack — Written entirely in TypeScript targeting React (declared only as a peer dependency, react: '*', with zero runtime dependencies of its own). It builds with microbundle into CommonJS, ESM, and UMD outputs, is tested with Jest and Testing Library under a jsdom environment, and enforces a strict sub-1 KB budget per entry point using size-limit. Linting is handled by ESLint with the standard config and Prettier.

Code Quality — Quality is high for a micro-library. Three substantial test files (useDebounce.test.tsx, useDebouncedCallback.test.tsx, useThrottledCallback.test.tsx, together over 40 KB) cover timing edges, cancellation, flushing, pending state, and server rendering. The public interfaces are fully typed and documented with JSDoc, naming mirrors the familiar lodash vocabulary, and the ref-based implementation carefully avoids stale closures across renders.

API Design — Developer experience is a core strength. Adopting lodash’s debounce/throttle naming and options (maxWait, leading, trailing) means the API is instantly familiar, and returning [value, controls] or a callable augmented with cancel/flush/isPending keeps usage terse. Getting started requires a single import and one hook call, and the README is dense with runnable CodeSandbox examples for each scenario.

Used by 40 apps in this directory

TypeScript
99%
Other

Rowy

Databases · Low Code Platforms

6,842

Manage Firestore data in an Airtable-like spreadsheet UI and build Cloud Functions workflows directly in your browser—on your own GCP project.

View details
45
Repo Health
71
Technical
65
Dependency
Built with
TypeScript 99%
Updated 1 years ago
Go
57%
MPL 2.0

shaper

Analytics · Data Engineering

1,265

Build analytics dashboards, reports, and customer-facing analytics by writing pure SQL — powered by DuckDB and designed for self-hosted deployment.

View details
80
Repo Health
79
Technical
71
Dependency
Built with
Go 57%
TypeScript 42%
Updated 6 days ago
Python
79%
AGPL 3.0

Skyvern

AI Agents · Automation

23,257

Skyvern (YC S2023) automates browser-based workflows by pairing LLMs with computer vision, letting agents click, fill, and extract data on sites they've never seen, without brittle XPath selectors that break on every layout change.

View details
89
Repo Health
82
Technical
70
Dependency
Built with
Python 79%
TypeScript 19%
Updated 5 days ago
TypeScript
89%
Other

Hexclave

Authentication · Developer Tools

6,877

The open-source user infrastructure platform — authentication, teams, payments, emails, analytics, and more on a single unified user model.

View details
88
Repo Health
80
Technical
66
Dependency
Built with
TypeScript 89%
Updated 5 days ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 5 days ago
TypeScript
48%
MIT

supermemory

AI Development · AI Memory · Note Taking

31,370

The state-of-the-art memory and context engine for AI agents — ranked #1 on all three major AI memory benchmarks.

View details
88
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 48%
MDX 32%
Python 17%
Updated 5 days ago
TypeScript
98%
MIT

Tersa

AI Agents · AI Development

1,043

An open-source visual canvas for building AI workflows by connecting nodes across 35+ model providers with drag-and-drop simplicity.

View details
46
Repo Health
77
Technical
71
Dependency
Built with
TypeScript 98%
Updated 6 months ago
TypeScript
55%
Other

Tolgee

Developer Tools

4,139

In-context localization platform that lets developers and translators edit app strings directly in the running application, with AI-powered machine translation and framework SDKs for React, Angular, Vue, and Svelte.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript 55%
Kotlin 44%
Updated 6 days ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers