more fine tuned control over infinite query #1008
Unanswered
yardenhochman
asked this question in
General
Replies: 0 comments
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.
-
I like the built in mechanism for generating the next call, with 'getFetchMore'. However there are currently 2 major issues I'm finding with this query type.
1.Impossible to opt out of inifine query sequential refetching
I cannot afford to refetch 10 scrolled pages every time a page becomes stale. My current solution is to remove all other pages when the component unmounts:
however ideally we'd do so only if the page became stale, not injudicously. It would be even better if there was a smart way to append new data to current data, if the order never changes. For example, if only 1 new post was now added to page 1, shift all posts between pages to maintain current page size, and avoid fetching additional pages.
2.smarter prefetch
right now prefetching the query results of page 1 creates an issue since 'getFetchMore' returns undefined. Ideally I'd like to have a dedicated prefetch function dedicated to the infinite query, but maybe I'm missing a better way to do it?
Summary
I think both issues have in common that there's no way to control what the current page count is. Ideally you'd have an array of existing fetches [1,2,3] when 3 pages have been fetched.
Beta Was this translation helpful? Give feedback.
All reactions