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 Request: Add pagination to queries #12

Open
emilianocalzada opened this issue Oct 29, 2024 · 3 comments
Open

Feature Request: Add pagination to queries #12

emilianocalzada opened this issue Oct 29, 2024 · 3 comments

Comments

@emilianocalzada
Copy link

Hey Convex team! 👋

I've been working with Convex in Svelte and noticed that usePaginatedQuery is only available in the React library. Pagination is pretty crucial for many of our projects, and I think having this feature in the Svelte version would be super helpful for the community.

Would love to see this added to maintain feature parity with React. Let me know if there's anything I can do to help make this happen!

Thanks for considering!

@thomasballinger
Copy link
Collaborator

thomasballinger commented Nov 19, 2024

The architecture is such that today the state for pagination is held in usePaginatedQuery. It should either be moved into the client or a stateful helper, or we need to write it again for Svelte.

@emilianocalzada
Copy link
Author

Hello convex team,

Any updates? this is the only thing that discourages me to use convex in my new projects

@thomasballinger
Copy link
Collaborator

We can write this again for Svelte, it shouldn't be bad! The gist is we need a new function like useQuery() that runs many other useQuery() hooks. Call it usePaginatedQuery(). It calls useQuery() with the passed-in arguments, then when a loadMore function is called it runs an additional useQuery() as well. All the results for all useQuery() functions are combined and returnd from usePaginatedQuery().

Would you want to give this a shot?

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