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

Method render

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

Source from the content-addressed store, hash-verified

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