prefetchQuery instead of ensureQueryData here?If the query exists and the data is not invalidated or older than the given staleTime, then the data from the cache will be returned. Otherwise it will try to fetch the latest data.
ensureQueryData does not check if the data is invalidated (see https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientensurequerydata)ensureQueryData is an asynchronous function that can be used to get an existing query's cached data. If the query does not exist, queryClient.fetchQuery will be called and its results returned.
ensureQueryData:prefetchQuery, the list view never shows the outdated item.https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 2mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago
TanStack AI Alpha 2 is here! 🖼️ Image, video, audio, speech, transcription, structured output 📦 Split adapters = smaller bundles, faster dev/contributions, easier 🎄 Fully tree shakable adapters ✨ Cleaner, flattened, fully type-safe APIs https://tanstack.com/blog/tanstack-ai-alpha-2
dry-scarlet · 3mo ago