useDebounce

Utility

A React hook that debounces a value, delaying updates until after a specified delay to optimize performance and reduce unnecessary operations.

Installation

npm install @thibault.sh/hooks

API Reference

Signature

function useDebounce<T>(value: T, delay: number): T

Parameters

NameTypeDescriptionDefault
value
T
The value to debounce.-
delay
number
The delay in milliseconds before the value updates.-

Returns

T

The debounced value that only updates after the delay period.