Skip to content
Discussion options

You must be logged in to vote

your initial example would work if you'd add $skip and $top to the result of your QueryFunction (getDataAsync). Right now, you're probably closing over old param values in getNextPageParam (that function should be pure and not close over anything).

So:

  • take the params you get into the QueryFuntion
  • compute the complete result inside the QueryFunction and return it
  • then, in getNextPageParam, that result is available in lastPage

The second approach builds on top of an API that we've removed in v5 (passing params to fetchNextPage), so I wouldn't do that. I'd encourage you to try out v5 alpha and see how it goes. We pass everything (all pageParams) to getNextPageParam so you won't have that …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@guhadebasish1
Comment options

Answer selected by guhadebasish1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants