Interface LazyLoadOptions

interface LazyLoadOptions {
    batchSize?: number;
    continueOnError?: boolean;
    truncate?: boolean;
}

Properties

batchSize?: number

Allows explicitly setting the expected amount of items on each data fetch. Must be a positive integer. If the batchSize value is set and an amount of items is fetched smaller than this value, the reachedEnd flag is set to true.

continueOnError?: boolean

If set to false (default), the reachedEnd will be set to true if the provided fetch function throws an error and the hook will stop fetching more data.

truncate?: boolean

Allows truncating the results if more results were fetched than allowed. For example, if you specify a max element count of 10, but you fetch in batches of 3, the last fetch will result in 12 elements if this is set to false. If it is set to true, it will only return 10 elements. This is also the default behavior.