MCPcopy
hub / github.com/TanStack/query / Page

Function Page

packages/solid-query/src/__tests__/suspense.test.tsx:40–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 let renders = 0
39
40 function Page() {
41 const [stateKey, setStateKey] = createSignal(key)
42
43 const state = useQuery(() => ({
44 queryKey: stateKey(),
45 queryFn: () => sleep(10).then(() => ++count),
46 }))
47
48 createRenderEffect(() => {
49 states.push({ ...state })
50 })
51
52 createRenderEffect(
53 on([() => ({ ...state }), () => key], () => {
54 renders++
55 }),
56 )
57
58 return (
59 <div>
60 <button aria-label="toggle" onClick={() => setStateKey(queryKey())} />
61 data: {String(state.data)}
62 </div>
63 )
64 }
65
66 const rendered = render(() => (
67 <QueryClientProvider client={queryClient}>

Callers

nothing calls this directly

Calls 5

sleepFunction · 0.90
queryKeyFunction · 0.90
useQueryFunction · 0.50
useInfiniteQueryFunction · 0.50
resetQueriesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…