algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.68k stars 514 forks source link

fix(queries): prevent network request #6205

Closed Haroenv closed 4 months ago

Haroenv commented 4 months ago

Summary

In index and instantsearch, keep track of which type of widgets are used, and only send a request of the right type.

Result

If only recommend or search widgets are present, only that request is done.

This has slight further impact to ensure that a render still happens when only recommend returns results.

FX-2892

codesandbox-ci[bot] commented 4 months ago

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 cfe8d23c03c233ad8dc1bd935dfb30d19345786f:

Sandbox Source
react-instantsearch-app Configuration