Hi everyone, two questions:
Hi everyone, two questions:
* let’s consider I want to have things in my DB that aren't dynamically updated as soon as it changes in the DB, is there a "static" getter?
* I see a preloadQuery for Next.js but can't find something similar for Svelte. Is there an alternative? I want to be able to prefetch server-side as I'm using SvelteKit
5 Replies
I guess this answers my 2nd question https://github.com/get-convex/convex-svelte/blob/main/src/routes/%2Bpage.server.ts
but then I don't seem to be able to consume this data as
initialData
or something to my useQuery
You can use
preloadQuery
, just need to specify the url
option as it defaults to the Next.js env var name for CONVEX_URL
.
re: a "static" getter -- you can either use an adapter to differentiate between updating data and updating UI (which I strongly recommend, otherwise you're opening yourself up to various caching/consistency woes). see this article: https://stack.convex.dev/help-my-app-is-overreacting and this video on
useBufferedState
https://stack.convex.dev/coping-with-the-web-s-looming-global-reactivity-crisisHelp, my app is overreacting!
Reactive backends like Convex make building live-updating apps a cinch, but default behavior might be too reactive for some use cases. Not to worry! L...
Managing Reactivity with useBufferedState
Reactivity has taken a dominant position today within web app development. Our components and app state are all reactive, and the world has adapted–mo...
if you're sure you want a static getter, then cool. yep, there is one. if you do
useConvex()
you'll get back the raw convex client, and then there is a query
method on it that's a one-shot fetch