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

Function getNextPageParam

packages/query-core/src/infiniteQueryBehavior.ts:132–145  ·  view source on GitHub ↗
(
  options: InfiniteQueryPageParamsOptions<any>,
  { pages, pageParams }: InfiniteData<unknown>,
)

Source from the content-addressed store, hash-verified

130}
131
132function getNextPageParam(
133 options: InfiniteQueryPageParamsOptions<any>,
134 { pages, pageParams }: InfiniteData<unknown>,
135): unknown | undefined {
136 const lastIndex = pages.length - 1
137 return pages.length > 0
138 ? options.getNextPageParam(
139 pages[lastIndex],
140 pages,
141 pageParams[lastIndex],
142 pageParams,
143 )
144 : undefined
145}
146
147function getPreviousPageParam(
148 options: InfiniteQueryPageParamsOptions<any>,

Callers 2

fetchFnFunction · 0.85
hasNextPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected