Open hemandev opened 7 months ago
@hemandev It sure is possible, yeah. If I were to solve this issue in a component library world, this is the way I'd go:
Page
component that accepts all arguments required for fetching a page (it can be cursor
, page
or whatever);Page
component, and pass props as arguments. Memoize the result (mamoization can be soft, without hard guarantees: nanoquery has its own data cache layer that's component/tree agnostic);Page
component whenever user approaches the bottom of current page.Basically, this thing.
But, as you can see, it's not something that looks particularly like useInfiniteQuery
, and there's no helpers that's part of the core yet, so it may require some custom code wrapping nanoquery. That's one of the features I'd like to implement some day, but right now it's not there yet.
Hi, First of all, let me say this is a great library, and I'm loving it so far.
I am using
query
along withnanostores
to build a framework-agnostic library, which I can then use to build components for each framework. All the business logic and reactivity stay in this "core" library.TLDR; Is it possible to do something like
useInfiniteQuery
in @tanstack/query? https://tanstack.com/query/v5/docs/framework/react/reference/useInfiniteQuery I want to build the whole infinite scroll data store inside VanillaJS so that I can reuse the same store in React, Vue, Angular etc...