Developer Docs
API Reference
React Hooks
Use Debounce
Functions
Function: useDebounceWithComparison()

web


web / lib/hooks/use-debounce / useDebounceWithComparison

Function: useDebounceWithComparison()

useDebounceWithComparison<T>(value, delay, compare?): T

Debounce hook with deep comparison for objects

Useful when you need to debounce objects and want to avoid unnecessary updates when object contents haven't actually changed.

Type Parameters

T

T

Parameters

value

T

The value to debounce

delay

number

Delay in milliseconds

compare?

(prev, next) => boolean

Custom comparison function (optional)

Returns

T

The debounced value