Data grid / foldkit-mixins-data-grid

MoreOnScroll

function · packages/mixins-data-grid/src/moreOnScroll.ts:14

function MoreOnScroll<Row, Id extends string, GridMessage, Message>(
  view: SlotView.SlotView<
    typeof GridSlots,
    GridInput<Row, Id, GridMessage, Message>,
    Message
  >,
): SlotView.SlotView<
  typeof GridSlots,
  GridInput<Row, Id, GridMessage, Message>,
  Message
>

Sends the grid's onMore as its More button comes within 200px of the grid's visible box, and again after each load while the button stays there; the button stays for the keyboard. Nothing is asked while the rows' source is busy. Attach it to a grid's view: DataGridView<Message>().define(Grid).pipe(MoreOnScroll).

In the guides