()
| 97 | } |
| 98 | |
| 99 | const App: Component = () => { |
| 100 | const [postId, setPostId] = createSignal(-1) |
| 101 | |
| 102 | return ( |
| 103 | <QueryClientProvider client={queryClient}> |
| 104 | <SolidQueryDevtools /> |
| 105 | <p> |
| 106 | As you visit the posts below, you will notice them in a loading state |
| 107 | the first time you load them. However, after you return to this list and |
| 108 | click on any posts you have already visited again, you will see them |
| 109 | load instantly and background refresh right before your eyes!{' '} |
| 110 | <strong> |
| 111 | (You may need to throttle your network speed to simulate longer |
| 112 | loading sequences) |
| 113 | </strong> |
| 114 | </p> |
| 115 | {postId() > -1 ? ( |
| 116 | <Post postId={postId()} setPostId={setPostId} /> |
| 117 | ) : ( |
| 118 | <Posts setPostId={setPostId} /> |
| 119 | )} |
| 120 | </QueryClientProvider> |
| 121 | ) |
| 122 | } |
| 123 | |
| 124 | const root = document.getElementById('root') |
| 125 | if (!root) throw new Error('Missing #root element') |
nothing calls this directly
no outgoing calls
no test coverage detected