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

Limit the results #52

Closed
brenoos opened this issue Dec 5, 2018 · 1 comment
Closed

Limit the results #52

brenoos opened this issue Dec 5, 2018 · 1 comment

Comments

@brenoos
Copy link

brenoos commented Dec 5, 2018

Hello.

There's a way to limite the results? For example: I just want the 5 first matches, not the all matches.

Thanks

@kentcdodds
Copy link
Owner

Hi @brenoos 👋

Use Array.prototype.slice. For example:

const allResults = matchSorter(list, searchString)
const firstFiveResults = allResults.slice(0, 5)

Good luck!

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

No branches or pull requests

2 participants