-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: Add useInfiniteQuery support #122
Conversation
Coverage Report
File Coverage
|
npm publish |
src/createUseQuery.mts
Outdated
}) { | ||
const methodName = getNameFromMethod(method); | ||
const customHookName = hookNameFromMethod({ method, className }); | ||
const queryKey = createQueryKeyFromMethod({ method, className }); | ||
|
||
const isInfiniteQuery = |
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.
should we throw an exception if 'queryString' is not set to 'useInfiniteQuery' and either pageParam or nextPageParam is undefined?
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.
Yes, throwing an exception would be safer, so I will add it.
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.
PR looks great! I would love to see some updates to the readme.
An infinite scroll example using an Intersection observer would be awesome.
It doesn't have to be in the PR :)
What's the state of the PR? |
#117
This new feature will generate a function in infiniteQueries.ts when the name specified by the pageParam option exists in the query parameters and the name specified by the nextPageParam option exists in the response.
Input:
Output:
This can be used as follows: