Skip to content
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

Merged
merged 14 commits into from
Oct 29, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Oct 7, 2020

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)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 7, 2020

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:

Sandbox Source
@algolia/js-example Configuration

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

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

looks good!

Haroenv and others added 9 commits October 23, 2020 14:57
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
Copy link
Member

@francoischalifour francoischalifour left a 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 🙂

@Haroenv Haroenv merged commit 753c8ca into next Oct 29, 2020
@Haroenv Haroenv deleted the fix/get-suggestions-nested branch October 29, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants