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

Function prefetch

packages/preact-query/src/__tests__/useQuery.test.tsx:3657–3665  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3655
3656 useEffect(() => {
3657 async function prefetch() {
3658 await queryClient
3659 .query({
3660 queryKey: key,
3661 queryFn: () => Promise.resolve('prefetched data'),
3662 })
3663 .catch(noop)
3664 act(() => setIsPrefetched(true))
3665 }
3666
3667 prefetch()
3668 }, [])

Callers 1

PageFunction · 0.70

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected