Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Feb 7, 2024
1 parent 0766e3c commit 8816db4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ composer require cerbero/lazy-json-pages
* [💧 Sources](#-sources)
* [🏛️ Pagination structure](#%EF%B8%8F-pagination-structure)
* [📏 Length-aware paginations](#-length-aware-paginations)
* [↪️ Cursor and next-page paginations](#%EF%B8%8F-cursor-and-next-page-paginations)
* [↪️ Cursor-aware paginations](#%EF%B8%8F-cursor-and-next-page-paginations)
* [👽 Custom pagination](#-custom-pagination)
* [🚀 Requests optimization](#-requests-optimization)
* [💢 Errors handling](#-errors-handling)
Expand Down Expand Up @@ -176,10 +176,17 @@ LazyJsonPages::from($source)
```


### ↪️ Cursor and next-page paginations
### ↪️ Cursor-aware paginations

> [!WARNING]
> The documentation of this feature is a work in progress.
Not all paginations are [length-aware](#-length-aware-paginations), some may be built in a way where each page has a cursor pointing to the next page.

We can tackle this kind of pagination by indicating the key or the header holding the cursor:

```php
LazyJsonPages::from($source)->cursor('pagination.cursor');
```

The cursor may be a number, a string or a URI: Lazy JSON Pages supports them all.


### 👽 Custom pagination
Expand Down

0 comments on commit 8816db4

Please sign in to comment.