Automattic / Automattic/wordpress-rs

Pagination support for all resources

Open
#37 3 comments 0 reactions 0 assignees View on GitHub
Discussion
Dominant language
Rust
Stars
36
Forks
5
Avg merge
17h 30m
Merged PRs (30d)
43

Description

It'd be nice to have a single [pagination implementation](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/) for all resources. What do you all think?

```swift
let users = wordPressApi.paginate(User.self, orderBy: \.name)
let firstPage: [User] = try await users.nextPage()
let secondPage: [User] = try await users.nextPage()

// Same syntax can be used on Post
let posts = wordPressApi.paginate(Post.self, orderBy: \.modifiedDate)
let firstPage: [User] = try await posts.nextPage()
let secondPage: [User] = try await posts.nextPage()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.