Convex query SWR
Hello, good day to everyone.
I want to share something that I hacked this Sunday, it's a useSWR-like for convex query, since the convex and tanstack query integration is said to be still in beta version, while the cache provider from
convex-helpers
require another package install + it is said to consume more bandwidth (I'm working on a place where cost must be pressed as much as possible).
useStableQuery
from the convex-helpers
repo also doesn't suit me, since useRef
value is gone if the component is unmounted, such as when navigating to different page.
No more UI flicker on params or page, showing previous (stale) value while refetching in the background.
Find the code here:
https://github.com/brandon-julio-t/convex-swr-jotaiGitHub
GitHub - brandon-julio-t/convex-swr-jotai: SWR version of convex re...
SWR version of convex react query using Jotai. Contribute to brandon-julio-t/convex-swr-jotai development by creating an account on GitHub.
0 Replies