Creates a debounced version of a function that delays its execution
until after delay milliseconds have elapsed since the last time it was called.
Useful for performance optimization on things like search inputs or window resizing.
The returned function includes a .cancel() method to clear any pending timers.
This is essential for cleaning up in component-based frameworks (like React)
to prevent updates on unmounted components.
Creates a debounced version of a function that delays its execution until after
delaymilliseconds have elapsed since the last time it was called. Useful for performance optimization on things like search inputs or window resizing. The returned function includes a.cancel()method to clear any pending timers. This is essential for cleaning up in component-based frameworks (like React) to prevent updates on unmounted components.