Function
fetchItems
(
page: number,
ts: number,
noNext?: boolean,
noPrev?: boolean,
)
Source from the content-addressed store, hash-verified
| 38 | const pageSize = 10 |
| 39 | |
| 40 | const fetchItems = ( |
| 41 | page: number, |
| 42 | ts: number, |
| 43 | noNext?: boolean, |
| 44 | noPrev?: boolean, |
| 45 | ): Promise<Result> => |
| 46 | sleep(10).then(() => ({ |
| 47 | items: [...new Array(10)].fill(null).map((_, d) => page * pageSize + d), |
| 48 | nextId: noNext ? undefined : page + 1, |
| 49 | prevId: noPrev ? undefined : page - 1, |
| 50 | ts, |
| 51 | })) |
| 52 | |
| 53 | describe('useInfiniteQuery', () => { |
| 54 | beforeEach(() => { |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…