Skip to content

Conversation

@ronaldmannak
Copy link

This PR simplifies pagination by adding a straightforward way to fetch subsequent pages.

I initially suspected I’d found a bug (see #17), but it turned out to be confusion caused by the lack of an end-to-end example and the way nextURL behaves. This PR clarifies the intended flow and makes “get the next page” a first-class operation.

Example usage:

var page = try await client.listModels(limit: 100)
print("Page 1: \(page.items.count) models")

while page.nextURL != nil {
    guard let next = try await client.nextPage(of: page) else { break }
    page = next
    print("Page: \(page.items.count) models")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant