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

Function customFetchData

packages/query-core/src/__tests__/hydration.test.tsx:698–709  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

696 let resolvePromise: (value: unknown) => void = () => undefined
697
698 const customFetchData = () => {
699 const promise = new Promise((resolve) => {
700 resolvePromise = resolve
701 })
702 // Resolve the promise in initial fetch
703 // because we are awaiting the query first time
704 if (isInitialFetch) {
705 resolvePromise('string')
706 }
707 isInitialFetch = false
708 return promise
709 }
710
711 await queryClient.prefetchQuery({
712 queryKey: key,

Callers 1

hydration.test.tsxFile · 0.85

Calls 1

resolvePromiseFunction · 0.85

Tested by

no test coverage detected