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