Skip to content

Debounce and Throttle

Debounce and Throttle are two patterns for controlling how often a function is executed in response to rapid events (typing, scrolling, resizing).

Debounce: Wait for pause, then execute (search, autocomplete). Throttle: Execute at max rate (scroll, resize, animation). Both prevent excessive function calls.