Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(useInstantSearch): expose status & error #3645

Merged
merged 7 commits into from
Oct 3, 2022

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Sep 30, 2022

Summary

Introduces status and error in the response of useInstantSearch, as well as a new option on useInstantSearch to indicate errors in the search lifecycle should be caught.

built on top of algolia/instantsearch#5127

Result

function Status() {
  const { status, error } = useInstantSearch({ catchError: true });

  return (
    <>
      <span>Search status: {status}</span>
      {error && <span>a search error occurred: {error.message}</span>}
    </>
  );
}

FX-1769

@Haroenv Haroenv requested review from a team, dhayab, FabienMotte and sarahdayan and removed request for a team September 30, 2022 13:26
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 30, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bd71141:

Sandbox Source
react-instantsearch-app Configuration
hooks-example Configuration

@netlify
Copy link

netlify bot commented Sep 30, 2022

Deploy Preview for react-instantsearch ready!

Name Link
🔨 Latest commit bd71141
🔍 Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/633ac5da916c260008314565
😎 Deploy Preview https://deploy-preview-3645--react-instantsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@Haroenv Haroenv enabled auto-merge (squash) October 3, 2022 11:22
@Haroenv Haroenv merged commit f436d31 into master Oct 3, 2022
@Haroenv Haroenv deleted the feat/use-instantsearch-status branch October 3, 2022 11:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants