()
| 21 | } |
| 22 | |
| 23 | function App() { |
| 24 | const [postId, setPostId] = createSignal(-1) |
| 25 | |
| 26 | return ( |
| 27 | <QueryClientProvider client={queryClient}> |
| 28 | <SolidQueryDevtools /> |
| 29 | <p> |
| 30 | As you visit the posts below, you will notice them in a loading state |
| 31 | the first time you load them. However, after you return to this list and |
| 32 | click on any posts you have already visited again, you will see them |
| 33 | load instantly and background refresh right before your eyes!{' '} |
| 34 | <strong> |
| 35 | (You may need to throttle your network speed to simulate longer |
| 36 | loading sequences) |
| 37 | </strong> |
| 38 | </p> |
| 39 | {postId() > -1 ? ( |
| 40 | <Post postId={postId()} setPostId={setPostId} /> |
| 41 | ) : ( |
| 42 | <Posts setPostId={setPostId} /> |
| 43 | )} |
| 44 | </QueryClientProvider> |
| 45 | ) |
| 46 | } |
| 47 | |
| 48 | function createPosts() { |
| 49 | return useQuery(() => ({ |
nothing calls this directly
no outgoing calls
no test coverage detected