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

Method render

examples/lit/basic/src/basic-query.ts:38–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 }
37
38 render() {
39 const query = this.todos()
40 return html`
41 <main>
42 <h1>Basic Query Example</h1>
43 <p data-testid="basic-query-status">
44 Status: <strong>${query.status}</strong>
45 </p>
46 <button
47 data-testid="basic-refetch"
48 @click=${() => this.todos.refetch()}
49 >
50 Refetch
51 </button>
52
53 ${
54 query.isPending
55 ? html`<p data-testid="basic-loading">Loading...</p>`
56 : null
57 }
58 ${
59 query.isError
60 ? html`<p data-testid="basic-error">
61 Error: ${query.error.message}
62 </p>`
63 : null
64 }
65
66 <ul data-testid="basic-todo-list">
67 ${(query.data?.items ?? []).map(
68 (todo) =>
69 html`<li data-testid="basic-todo-item">${todo.title}</li>`,
70 )}
71 </ul>
72 </main>
73 `
74 }
75}
76
77customElements.define('basic-query-example', BasicQueryExample)

Callers

nothing calls this directly

Calls 1

refetchMethod · 0.80

Tested by

no test coverage detected