Skip to content

Commit 76f1a47

Browse files
committed
Removed invalid syntax from pagination docs
1 parent 5ac1077 commit 76f1a47

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎SpotifyAPI.Docs/docs/pagination.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ It allows to receive only a subset of all available data and dynamically check i
1414
`PaginateAll` will query all remaining elements based on a first page and return all of them in a `IList`. This method should not be used for a huge amount of pages (e.g `Search` Endpoint), since it stores every response in memory.
1515

1616
```csharp
17-
// we need the first page, every syntax can be used for pagination
17+
// we need the first page
1818
var page = await spotify.Playlists.CurrentUsers();
19-
var page = spotify.Playlists.CurrentUsers();
20-
var page = () => spotify.Playlists.CurrentUsers();
2119

2220
// allPages will include the first page retrived before
2321
var allPages = await spotify.PaginateAll(page);
@@ -31,10 +29,8 @@ var allPages = await spotify.PaginateAll(page);
3129
`Paginate` is based on `IAsyncEnumerable` and streams pages instead of returning them all in one list. This allows to break the fetching early and keeps only 1 page in memory at a time. This method should always be preferred to `PaginateAll`
3230

3331
```csharp
34-
// we need the first page, every syntax can be used for pagination
32+
// we need the first page
3533
var page = await spotify.Playlists.CurrentUsers();
36-
var page = spotify.Playlists.CurrentUsers();
37-
var page = () => spotify.Playlists.CurrentUsers();
3834

3935
await foreach(var item in spotify.Paginate(page))
4036
{

0 commit comments

Comments
 (0)