()
| 127 | } |
| 128 | |
| 129 | const App: Component = () => { |
| 130 | const [postId, setPostId] = createSignal(-1) |
| 131 | |
| 132 | return ( |
| 133 | <QueryClientProvider client={queryClient}> |
| 134 | <SolidQueryDevtools /> |
| 135 | <p> |
| 136 | As you visit the posts below, you will notice them in a loading state |
| 137 | the first time you load them. However, after you return to this list and |
| 138 | click on any posts you have already visited again, you will see them |
| 139 | load instantly and background refresh right before your eyes!{' '} |
| 140 | <strong> |
| 141 | (You may need to throttle your network speed to simulate longer |
| 142 | loading sequences) |
| 143 | </strong> |
| 144 | </p> |
| 145 | {postId() > -1 ? ( |
| 146 | <Post postId={postId()} setPostId={setPostId} /> |
| 147 | ) : ( |
| 148 | <Posts setPostId={setPostId} /> |
| 149 | )} |
| 150 | </QueryClientProvider> |
| 151 | ) |
| 152 | } |
| 153 | |
| 154 | const root = document.getElementById('root') |
| 155 | if (!root) throw new Error('Missing #root element') |
nothing calls this directly
no outgoing calls
no test coverage detected