MCPcopy Create free account
hub / github.com/TanStack/query / prefetch

Function prefetch

packages/solid-query/src/__tests__/useQuery.test.tsx:3193–3201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3191
3192 createEffect(() => {
3193 async function prefetch() {
3194 await queryClient
3195 .query({
3196 queryKey: key,
3197 queryFn: () => Promise.resolve('prefetched data'),
3198 })
3199 .catch(noop)
3200 setPrefetched(true)
3201 }
3202 prefetch()
3203 })
3204

Callers 1

PageFunction · 0.70

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected