Replies: 1 comment
-
Did you make any progress with this? I am looking for something similar |
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
-
I've been trying to make the integration between
react-query
andreact-virtualized
'sInfiniteLoader
possible, however I got stuck at a particular point.Namely, the
InfinteLoader
'sfetchMore
function is invoked with anIndexRange
({ startIndex: number, stopIndex: number }
). This is important because the batch size can vary and usually the initially batch size is larger than the subsequent batches. Hence it is imperative for thequeryFn
to have access to thestartIndex
,stopIndex
or a computedlimit
. For this integration I've been using the firebase sdk however the principal of a cursor is used more widely. I won't go into the specifics, however,firebase
'sstartAfter
collection filter is accepts the reference to the last loaded document. Fortunately, thegetFetchMore
function is invoked with the last batch and the last document in the batch represents the cursor after which the next batch starts. The point being that there is not way to pass both thelimit
and the last document reference to the query function in order to load the new batch.Is there are workaround?
Beta Was this translation helpful? Give feedback.
All reactions