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

Class Page

packages/angular-query/src/__tests__/inject-query.test.ts:541–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539 const key = createKey()
540
541 @Component({
542 template: `
543 <div>data: {{ query.data() }}</div>
544 <div>isPlaceholderData: {{ query.isPlaceholderData() }}</div>
545 <div>isSuccess: {{ query.isSuccess() }}</div>
546 `,
547 })
548 class Page {
549 readonly query = injectQuery(() => ({
550 queryKey: key,
551 queryFn: () => sleep(10).then(() => 'real-data'),
552 placeholderData: 'placeholder',
553 }))
554 }
555
556 const rendered = await render(Page)
557

Callers

nothing calls this directly

Calls 4

sleepFunction · 0.90
signalFunction · 0.90
injectQueryFunction · 0.85
ComponentFunction · 0.50

Tested by

no test coverage detected