-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(example): set up GitHub filters example with Algolia #814
Conversation
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 19523b2:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works nicely! slightly confusing there's no submit override but it just refreshes
@@ -148,7 +154,7 @@ autocomplete<AutocompleteItem>({ | |||
showQuerySource && querySource, | |||
showPrefixesSource && prefixesSource, | |||
showPostfixesSource && postfixesSource, | |||
].filter(Boolean); | |||
].filter(Boolean) as Array<AutocompleteSource<AutocompleteItem>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the cast needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not every source returns items that exactly satisfy the AutocompleteItem
contract (sometimes there's more data, sometimes there's less), but there's enough overlap so that it doesn't matter, and each source has its own template anyway.
I think I can improve types in a separate PR since this is only a demo.
Co-authored-by: Haroen Viaene <hello@haroen.me>
This swaps the static sources for repositories, authors and organizations with Algolia indices. This allows us to leverage Algolia features (full-text search, highlighting, custom ranking, search for facet values, etc.).
When a tag is selected, it's removed from the available filters to avoid adding the same tag twice and polluting the results.
Sans.titre.mov
The indices are static extracts from the GitHub public API, indexed in Algolia. They contain a list of public repos from Algolia and CodeSandbox, along with public members of both organizations.
sandbox