()
| 31 | }) |
| 32 | |
| 33 | function App() { |
| 34 | const [postId, setPostId] = createSignal(-1) |
| 35 | |
| 36 | return ( |
| 37 | <QueryClientProvider client={queryClient}> |
| 38 | <SolidQueryDevtools /> |
| 39 | <p> |
| 40 | As you visit the posts below, you will notice them in a loading state |
| 41 | the first time you load them. However, after you return to this list and |
| 42 | click on any posts you have already visited again, you will see them |
| 43 | load instantly and background refresh right before your eyes!{' '} |
| 44 | <strong> |
| 45 | (You may need to throttle your network speed to simulate longer |
| 46 | loading sequences) |
| 47 | </strong> |
| 48 | </p> |
| 49 | <Show when={postId() > -1} fallback={<Posts setPostId={setPostId} />}> |
| 50 | <Post postId={postId()} setPostId={setPostId} /> |
| 51 | </Show> |
| 52 | </QueryClientProvider> |
| 53 | ) |
| 54 | } |
| 55 | |
| 56 | function Posts(props: { setPostId: Setter<number> }) { |
| 57 | // All you have to do now is pass a key! |
nothing calls this directly
no outgoing calls
no test coverage detected