()
| 2 | import { useQuery } from '@tanstack/solid-query' |
| 3 | |
| 4 | const 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 | |
| 22 | export default App |
nothing calls this directly
no test coverage detected