Usage of query-core with Qwik.js #9118
Unanswered
omerman
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently started using Qwik.js. I love Tanstack Query, and decided I wanted to write a little something to handle deduplication and caching.
Since in Qwik the serverside and clientside line is vague to non-existent almost.. I created a shared Fetcher class to be used both for client fetches and for SSR fetches. and created a copy of QueryClient in both the server and client with different defaults(longer caching in the server).
It works perfectly
P.S - If you do make it your own, be sure to add some kind of cache persistor in the Server so that the memory consumption will not be too large, I will implement my own soon and might add it here
If you need something like this, you are more than welcome to make it your own:
Beta Was this translation helpful? Give feedback.
All reactions