MCPcopy Create free account
hub / github.com/TanStack/query / render

Method render

examples/lit/basic/src/main.ts:161–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159 }
160
161 render() {
162 const query = this.todosQuery()
163 const mutation = this.createTodoMutation()
164 const todos = query.data?.items ?? []
165
166 return html`
167 <main>
168 <h1>TanStack Lit Query E2E Demo</h1>
169 <p>Verifies integration between Lit, query-core, and this adapter.</p>
170
171 <section>
172 <div data-testid="query-status">query: ${query.status}</div>
173 <div data-testid="mutation-status">mutation: ${mutation.status}</div>
174 <div data-testid="active-fetches">fetches: ${this.isFetching()}</div>
175 <div data-testid="active-mutations">
176 mutations: ${this.isMutating()}
177 </div>
178 <div data-testid="request-count">
179 server-requests: ${query.data?.requestCount ?? 0}
180 </div>
181 <div data-testid="data-source">
182 source: ${query.data?.source ?? 'none'}
183 </div>
184 </section>
185
186 <section>
187 <button
188 data-testid="refetch"
189 @click=${() => this.todosQuery.refetch()}
190 >
191 Refetch
192 </button>
193 <button
194 data-testid="invalidate"
195 @click=${() => this.invalidateTodos()}
196 >
197 Invalidate
198 </button>
199 <button
200 data-testid="seed-cache"
201 @click=${() => this.seedCacheOnlyTodo()}
202 >
203 Seed Cache
204 </button>
205 <button
206 data-testid="reset-demo-state"
207 @click=${() => this.resetDemoState()}
208 >
209 Reset Demo State
210 </button>
211 <button
212 data-testid="fail-next-fetch"
213 @click=${() => this.forceNextFetchFailure()}
214 >
215 Fail Next Fetch
216 </button>
217 <button
218 data-testid="fail-next-mutation"

Callers

nothing calls this directly

Calls 9

invalidateTodosMethod · 0.95
seedCacheOnlyTodoMethod · 0.95
resetDemoStateMethod · 0.95
forceNextFetchFailureMethod · 0.95
addTodoMethod · 0.95
refetchMethod · 0.80
isFetchingMethod · 0.45
isMutatingMethod · 0.45

Tested by

no test coverage detected