wess
wess2mo ago

0xwess's Thread

If if have a useQuery on component, and the same useQuery on its child component, is it wasting resources, or is it smart enough to handle this for me?
3 Replies
convex-threads
convex-threads2mo ago
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. If this is a support-related question, please create a post in #support-community. If not, carry on! Thanks!
lee
lee2mo ago
If the same useQuery is active at the same time, they will he deduped on the client side, so you're good. If you want to unmount the useQuery in between, you'll need something like this to stay subscribed while the query isn't active: https://youtu.be/ZgxDlSUGpfE?si=iUzFcoTJPD8lrJbN
Convex
YouTube
Can your database do this? Ep. 1: Magic caching
A Next.js app with no query cache? Jank. One with a cache? No more jank, but now we need to deal with cache invalidation and application consistency. Ugh. But with Convex's magic query cache, Convex's powerful subscriptions are cached, not merely values. So you get the best of both words. Repository here: https://github.com/jamwt/cached-dmv ...
wess
wessOP2mo ago
Awesome, thanks @lee

Did you find this page helpful?