makeIterable

inline fun <T> makeIterable(noinline countGetter: () -> Long, pageSize: Int = defaultPaginationPageSize, noinline paginationResultGetter: Pagination.() -> PaginationResult<T>): Iterable<T>(source)

Creates an Iterable that lazily fetches items from a paginated data source. This is useful for iterating over large datasets without loading all items into memory at once.

Return

An Iterable that can be used in for-loops or other iterable contexts

Parameters

countGetter

A function that returns the total count of available items

pageSize

The size of each page to fetch. Defaults to defaultPaginationPageSize

paginationResultGetter

A function that fetches a page of results for a given pagination

Type Parameters

T

The type of items being iterated