@helix-x/datagrid-ui - v0.1.2
    Preparing search index...

    Function useServerDataSource

    • Server-side paging with a small block cache.

      DataGrid uses this internally; call it directly only when building a custom surface on top of the same data contract.

      Type Parameters

      • T

        The row type.

      Parameters

      Returns UseServerDataSourceResult<T>

      The current page plus loading state and imperative helpers.

      Every request carries an AbortController and a sequence number, so a slow response for an old sort or filter can never overwrite a newer one. The cache is dropped wholesale when the query changes, so stale blocks are never mixed with fresh ones.

      const { rows, totalRows, isLoading, refresh } = useServerDataSource({
      dataSource,
      page: 0,
      pageSize: 50,
      sortModel: [{ colId: 'name', sort: 'asc' }],
      filterModel: {},
      });