do For All
inline fun <T> doForAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: (Pagination) -> PaginationResult<T>)(source)
Executes block for each page in a paginated sequence. The paginationMapper determines the next pagination to use based on the current result. Stops when paginationMapper returns null.
Parameters
initial Pagination
The pagination to start with. Defaults to FirstPagePagination
pagination Mapper
Function that determines the next pagination based on the current result. Return null to stop
block
Function that processes each page and returns a PaginationResult
Type Parameters
T
The type of items in each page