Helpful
    Preparing search index...

    Function useMoreViewState

    • A type of view that loads the next set of data in batches.

      This kind of state is useful for views that don't need the total count and instead load more data when requested. You can use this to implement infinite scrolling.

      Type Parameters

      • T = any

        The type of data that the source will return.

      Parameters

      • source: IZDataSource<T>

        The data source to load from.

      • template: IZDataRequest

        The template request. The page size will be used as the batch size. The page to load will be ignored and will instead be controlled by this hook.

      Returns {
          complete: boolean;
          last: ZAsyncDataState<T[]>;
          more: () => void;
          page: number;
          reset: () => void;
          size: number;
          view: T[];
      }

      The current view, last result, page number, and batch size. Also returns the method to load the next batch.