Use Debounced Callback โ shadcn/ui Hook by mizzle | shadcnregistry
Use Debounced Callback
hook
Wraps a callback so it runs once the calls stop for a given time, always with the newest arguments and the newest callback. A call still waiting when the component unmounts runs then, so the last keystroke before a popover closes is not lost.