redux-toolkit
redux-toolkit copied to clipboard
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