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

Function App

integrations/solid-vite/src/App.jsx:4–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { useQuery } from '@tanstack/solid-query'
3
4const App = () => {
5 const query = useQuery(() => ({
6 queryKey: ['test'],
7 queryFn: async () => {
8 await new Promise((r) => setTimeout(r, 1000))
9 return 'Success'
10 },
11 }))
12
13 return (
14 <Switch>
15 <Match when={query.isPending}>Loading...</Match>
16 <Match when={query.isError}>An error has occurred!</Match>
17 <Match when={query.isSuccess}>{query.data}</Match>
18 </Switch>
19 )
20}
21
22export default App

Callers

nothing calls this directly

Calls 1

useQueryFunction · 0.90

Tested by

no test coverage detected