Skip to content

Add helper for debouncing creator search input before firing API request #488

Description

@Chucks1093

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

  • Debounced value updates after delay elapses
  • Rapid input changes do not trigger multiple updates
  • Timeout cleaned up on unmount
  • Unit tests cover all three cases

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions