Lazy infinite queries hook
The ability to use infinite queries with a lazy hook just like normal lazy queries.
useLazyGetPokemonInfiniteQuery.
Use case
The ability to get the data from multiple different arguments. Currently there is no way to dynamically call the infiniteQuery for with different arguments as hooks are not loopable.
const [getPokemon] = useLazyGetPokemonInfiniteQuery()
for (const type in types) {
getPokemon(type)
}
Issues
How do you deal with the fetchNextPage
This looks like a bit of an "X/Y problem" kind of request.
Lazy queries aren't meant for looping and triggering many requests in a row.
What's your use case for making multiple requests like that?
Maybe the use case is a bit niche I will admit.
The use case for loading grouped table data. The groups are completely dynamic and each group needs to fetch all it's own items. A group can have 1000+ items in it so there needs to be some kind of pagination involved.
But maybe i'm thinking about it all wrong!
But the point of pagination is usually that you don't get all the pages, but just the page that's currently on screen. Otherwise you're back at square one: the server does a lot of useless work and your browser memory fills up with stuff that's currently irrelevant.
I ended up here because I'm facing a similar issue. In my case, I need to re-trigger the full pagination and reset it to page one when filtering the list, and I also need some form of debounce for the search input.