-
Notifications
You must be signed in to change notification settings - Fork 470
feat: add generics to screen queries #1034
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
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 feb9b15:
|
Codecov Report
@@ Coverage Diff @@
## main #1034 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 920 920
Branches 284 284
=========================================
Hits 920 920
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
text: infer P, | ||
options: infer Q, | ||
container: HTMLElement, | ||
...args: infer P |
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.
This syntax is available from TS v3.0.1
@timdeschryver Could you check if the generics work with |
@nstepien Yep, we can do that in a follow up PR when this PR is approved. |
@timdeschryver Feel free to merge. |
🎉 This PR is included in version 8.7.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
Adding generics to screen queries.
Follow up to #1023, which added generics to query methods
Closes #1033
Why:
So users that use screen queries can also use generics.
How:
BoundFunction
to a generic type that removes the first argument (the container)screen
type because it isn't possible to reuse the queries while keeping the genericChecklist:
docs site