MCPcopy Index your code
hub / github.com/TanStack/virtual / fetchServerPage

Function fetchServerPage

examples/react/infinite-scroll/src/main.tsx:15–26  ·  view source on GitHub ↗
(
  limit: number,
  offset: number = 0,
)

Source from the content-addressed store, hash-verified

13const queryClient = new QueryClient()
14
15async function fetchServerPage(
16 limit: number,
17 offset: number = 0,
18): Promise<{ rows: Array<string>; nextOffset: number }> {
19 const rows = new Array(limit)
20 .fill(0)
21 .map((_, i) => `Async loaded row #${i + offset * limit}`)
22
23 await new Promise((r) => setTimeout(r, 500))
24
25 return { rows, nextOffset: offset + 1 }
26}
27
28function App() {
29 const {

Callers 1

AppFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected