This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom React hook that provides a debounced version of a state value. | |
* | |
* @template T - The type of the state value. | |
* @param initialValue - The initial value of the state. | |
* @param delay - The debounce delay in milliseconds. | |
* @returns A tuple containing: | |
* - The current value. | |
* - An update function that merges new partial values into the current value. | |
* - The debounced value, which updates after the specified delay. |