Skip to content

Refine useSearch interface #51

Description

@cjcenizal

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 }.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions