getAll

inline fun <T> getAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: (Pagination) -> PaginationResult<T>): List<T>(source)

Retrieves all items from a paginated source by repeatedly calling block with different pagination parameters. The paginationMapper determines the next pagination to use based on the current result.

Return

A list containing all retrieved items from all pages

Parameters

initialPagination

The pagination to start with. Defaults to FirstPagePagination

paginationMapper

Function that determines the next pagination based on the current result. Return null to stop

block

Function that retrieves a page of results for the given pagination

Type Parameters

T

The type of items being retrieved