Closed jamwt closed 3 months ago
A couple thoughts just coming to me:
react/cache
entrypoint in a single file.useQuery
hook in helpers to also do this, but only if it's in the cache provider - and maybe push folks to use that one. As it stands there will be 3 options for useQuery
: vanilla, this one, and tanstack-style. there's a usecase for vanilla - if you don't want to use the caching - but that implies there should be an opt-out for the tanstack-style one too. So either 2 versions (TanStack to also get caching, vanilla if you want to opt out), or 4 versions (full permutations - or an extra arg to tanstack about opting out). I kinda wish I had gone with a single object arg for the tanstack one after all ({ queryFn, queryArgs }
) Was it intentional to keep it out of the npm package for now, just to point people to it?
Okay, I
useQueries
so that the tanstack-style wrapper can use this cache.convex-helpers
package, in the react module.
Implementation of a query cache that can dramatically speed up re-rendering of values as SPA routes change and components are unmounted and remounted.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.