This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 386
feat(indexId): refactor createInstantSearchServer [PART-5] #1843
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for react-instantsearch ready! Built with commit 0742df3 https://deploy-preview-1843--react-instantsearch.netlify.com |
tkrugg
approved these changes
Jan 3, 2019
samouss
force-pushed
the
feat/part-4-ssr
branch
from
January 3, 2019 14:59
3749e78
to
af8f7c2
Compare
samouss
force-pushed
the
feat/part-5-refactor-ssr
branch
from
January 3, 2019 15:03
e04c937
to
6783634
Compare
samouss
force-pushed
the
feat/part-4-ssr
branch
from
January 3, 2019 15:30
af8f7c2
to
cb92955
Compare
samouss
force-pushed
the
feat/part-5-refactor-ssr
branch
from
January 3, 2019 15:32
6783634
to
fccab1d
Compare
samouss
added a commit
that referenced
this pull request
Jan 4, 2019
samouss
added a commit
that referenced
this pull request
Jan 4, 2019
samouss
added a commit
that referenced
this pull request
Jan 4, 2019
* feat(indexId): rely on indexId rather than indexName [PART-2] (#1835) * feat(indexId): refactor createInstantSearchManager [PART-3] (#1840) * feat(indexId): rely on indexId rather than indexName in SSR [PART-4] (#1842) * feat(indexId): refactor createInstantSearchServer [PART-5] (#1843) * feat(indexId): rename getIndex -> getIndexId [PART-6] (#1851)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR does not introduce new feature, it's a refactor of
createInstantSearchServer
. The logic to create the search parameters and search was hard to follow. We tried to put name on this logic to help the reader to follow what happens. Now each step has a dedicated function: create the search parameters, search into a single index and search into multiple indices.Changes
createInstantSearchServer
: extract the logic that was mixed insidefindResultsState
into multiple functions:getSearchParameters
,singleIndexSearch
andmultiIndexSearch
.createInstantSearchManager
: the logic for hydrate the results and collect the search parameters move on the component instance.