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

Class Page

packages/angular-query-experimental/src/__tests__/inject-query.test.ts:290–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288 const key = queryKey()
289
290 @Component({
291 template: `
292 <div>status: {{ query.status() }}</div>
293 <div>data: {{ query.data() ?? 'none' }}</div>
294 <div>isPending: {{ query.isPending() }}</div>
295 <div>isFetching: {{ query.isFetching() }}</div>
296 <div>isFetched: {{ query.isFetched() }}</div>
297 <div>isSuccess: {{ query.isSuccess() }}</div>
298 `,
299 })
300 class Page {
301 readonly query = injectQuery(() => ({
302 queryKey: key,
303 queryFn: () => sleep(10).then(() => 'result2'),
304 }))
305 }
306
307 const rendered = await render(Page)
308

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
injectQueryFunction · 0.85
ComponentFunction · 0.50

Tested by

no test coverage detected