react-search icon indicating copy to clipboard operation
react-search copied to clipboard

Refine useSearch interface

Open cjcenizal opened this issue 1 year ago • 0 comments

This hook currently returns { fetchSearchResults, isLoading }. I noticed two things:

  • We're using two different verbs to describe the same action: "fetch" and "load"
  • The action is verbose but the state is terse

I think we can reconcile these differences and create more symmetry between the action and the state. I suggest erring on the side of verbosity to avoid potential conflicts with the consumer's variables, e.g. a local isLoading variable. I'd suggest { fetchSearchResults, isFetchingSearchResults }.

cjcenizal avatar Mar 08 '24 14:03 cjcenizal