-
Notifications
You must be signed in to change notification settings - Fork 329
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
fix(getSuggestions): allow nested arrays to be returned #331
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 9d5fb35:
|
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.
looks good!
packages/autocomplete-core/src/__tests__/getAutocompleteSetters.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/__tests__/getAutocompleteSetters.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/__tests__/getAutocompleteSetters.test.ts
Outdated
Show resolved
Hide resolved
f7c92af
to
8e4b48f
Compare
this is useful, since it allows getAlgoliaHits to be used top-level, but also within a single source, without having to take the first element of the array manually
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
13e6dc3
to
dc4ef68
Compare
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.
Last comments and let's merge this if types are correct 🙂
Summary
It flattens the result of getSuggestions. this is useful, since it allows getAlgoliaHits to be used top-level, but also within a single source, without having to take the first element of the array manually
Result
you can use getAlgoliaHits top-level in getSources, but also in getSuggestions (like in the docs: https://algolia-autocomplete.netlify.app/docs/autocomplete-js)