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

Function getPreviousPageParam

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

Source from the content-addressed store, hash-verified

145}
146
147function getPreviousPageParam(
148 options: InfiniteQueryPageParamsOptions<any>,
149 { pages, pageParams }: InfiniteData<unknown>,
150): unknown | undefined {
151 return pages.length > 0
152 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)
153 : undefined
154}
155
156/**
157 * Checks if there is a next page.

Callers 1

hasPreviousPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected