We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
useFirestoreInfiniteQuery
Hey, I'm just wondering if this is supported or if there's a workaround to make this work with this library?
The goal is to have an infinite scroll list where the items update in realtime.
The text was updated successfully, but these errors were encountered:
https://github.com/vpishuk/react-query-firebase This package has useInfiniteQuery hook. Here is an example of how to use it:
useInfiniteQuery
const getInitialPageParam = () => { return by === "createdOn" ? direction === "desc" ? Infinity : -Infinity : direction === "desc" ? "~" : ""; }; const getNextPageParam = (lastPage) => { return (lastPage?.length ?? 0) > 0 ? lastPage[lastPage.length - 1].createdOn : ""; }; const getPrevPageParam = (firstPage) => { return (firstPage?.length ?? 0) > 0 ? firstPage[0].createdOn : ""; }; const collectionReference = useCollectionReference({ path: COLLECTION_PATH }).withConverter(converter); useInfiniteQuery({ options: { queryKey: ['mykey'], initialPageParam: startAfter(getInitialPageParam()), getNextPageParam: (lastPage) => { return startAfter(getNextPageParam(lastPage)); }, getPreviousPageParam: (firstPage) => { return endBefore(getPrevPageParam(firstPage)); }, }, query: collectionReference, queryConstraints: [orderBy(by, direction)] });
Sorry, something went wrong.
No branches or pull requests
Hey, I'm just wondering if this is supported or if there's a workaround to make this work with this library?
The goal is to have an infinite scroll list where the items update in realtime.
The text was updated successfully, but these errors were encountered: