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

Class Host

packages/lit-query/src/__tests__/createQueriesController.test.ts:174–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 const key2 = createKey()
173
174 class Host extends LitElement {
175 readonly queries = createQueriesController(
176 this,
177 {
178 queries: [
179 {
180 queryKey: key1,
181 queryFn: () => sleep(10).then(() => 'alpha'),
182 },
183 {
184 queryKey: key2,
185 queryFn: () => sleep(10).then(() => 'beta'),
186 },
187 ],
188 combine: (results) => results.map((result) => result.data),
189 },
190 queryClient,
191 )
192
193 override render() {
194 const data = this.queries().map((result) => result ?? 'none')
195 return html`data: ${data.join(', ')}`
196 }
197 }
198
199 customElements.define(generateElementName(), Host)
200 const host = new Host()

Callers

nothing calls this directly

Calls 4

sleepFunction · 0.90
createQueriesControllerFunction · 0.85
resolveFunction · 0.85
queryOptionsFunction · 0.50

Tested by

no test coverage detected