Primitives / foldkit-primitives/state

isAtEnd

function · packages/primitives/src/state/virtual.ts:219

function isAtEnd(
  model: VirtualModel,
  keys: ReadonlyArray<string>,
  viewportHeight: number,
  threshold?: number,
): boolean

Whether the viewport rests at (or past) the end, within threshold pixels: the infinite-scroll check. An empty list counts as ended — there is nothing to scroll, so more should load. Thresholds below zero clamp to zero.