Summary
The creator search input fires an API request on every keystroke. A debounce helper that waits until the user stops typing for 300ms before triggering the search will reduce unnecessary requests and prevent the list from flickering on every character.
Scope
- Add
useDebounce<T>(value: T, delay: number): T hook
- Returns the debounced value after the delay has elapsed without the value changing
- Cleans up the timeout on unmount
- Add unit tests for: value updates after delay, value does not update before delay, rapid changes only trigger one update
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The creator search input fires an API request on every keystroke. A debounce helper that waits until the user stops typing for 300ms before triggering the search will reduce unnecessary requests and prevent the list from flickering on every character.
Scope
useDebounce<T>(value: T, delay: number): ThookAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram