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

Function prefetch

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

Source from the content-addressed store, hash-verified

3118
3119 createEffect(() => {
3120 async function prefetch() {
3121 await queryClient
3122 .query({
3123 queryKey: key,
3124 queryFn: () => Promise.resolve('prefetched data'),
3125 })
3126 .catch(noop)
3127 setPrefetched(true)
3128 }
3129 prefetch()
3130 })
3131

Callers 1

PageFunction · 0.70

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected