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

[feature] add support for generic type #75

Merged
merged 8 commits into from
Apr 9, 2024
Merged

[feature] add support for generic type #75

merged 8 commits into from
Apr 9, 2024

Conversation

mlbonniec
Copy link
Contributor

@mlbonniec mlbonniec commented Apr 7, 2024

WHY is this change introduced?

To allow returning a custom type instead of the SearchItem

Resolves #72

WHAT does this PR introduce or fix?

Generic type support has been added.

QA Checklist

  • I have updated the README.md and related documentation, if necessary

Dependency-specific Checklist

No dependency has been added

Usage-specific Checklist

  • The hook's API remains consistent and user-friendly
  • Any new features have been documented with clear examples

Release Notes

Note: once this PR is merged, a new release or update might be required for the users.

  • The search function now takes an optional generic type.
  • keys array is now an array of the generic type keys, so it's improving type completion, and prevent mistakes.

Copy link
Owner

@SMAKSS SMAKSS left a comment

Choose a reason for hiding this comment

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

Thank you for the great work. LGTM.

I've included a test framework in the repo. Can you add the respective tests for this change as well? It is much appreciated. 🎉

@mlbonniec
Copy link
Contributor Author

I've updated existing tests to use a Person type, instead of no type.

@SMAKSS SMAKSS merged commit 08bfb76 into SMAKSS:master Apr 9, 2024
2 checks passed
@mlbonniec mlbonniec deleted the 72-use-generic-type branch April 9, 2024 10:30
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.

Replace SearchItem type into a generic type
2 participants