Does cursor-based pagination work with on-demand infinite syncing? #1028
Unanswered
Nick-Motion
asked this question in
Q&A
Replies: 1 comment
-
|
cc @samwillis |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I'm trying to implement infinite scroll using
useLiveInfiniteQuerywith a collection usingsyncMode: 'on-demand'. Having trouble understanding how cursor-based pagination should work.Setup
Collection:
Hook:
Observed Behavior
Initial load:
queryFncalled withlimit: 50. Returns 50 items.Peek-ahead:
queryFncalled again either withlimit: 1. Returns 1 item,hasNextPage: true.fetchNextPagecalled:loadedPageCountgoes 1→2, butqueryFnis NOT called again.hasNextPageflips tofalse:dataArray.length (51) > totalItemsRequested (100)is false.Questions
Does cursor-based pagination (PR feat(db,electric,query): separate cursor expressions for flexible pagination #960) work with on-demand syncing?
What's the recommended approach for infinite scroll with on-demand collections?
Versions
Beta Was this translation helpful? Give feedback.
All reactions