You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Make storage clients list methods return value also be asyncIterator of relevant data (#803)
### Description
- Extends the return value of storage list methods by `asyncIterator`
that can be used to iterate over individual items:
- `DatasetClient.listItems`
- `KeyValueStoreClient.listKeys`
- `RequestQueueClient.listRequests`
- Generalize `asyncIterator` pagination tests so that each method is
tested with options it supports
- Add stricter runtime checks on `limit` and `offset` (They would cause
API errors anyway)
- Add a comment about the undocumented behavior of `exclusiveStartId`
- Update example code in docs
### Example usage
It can still be used the same way as before, and additionally, it can be
used like this now:
```ts
...
for await (const item of datasetClient.listItems({ limit, offset, chunkSize })) {
allItems.push(item);
}
console.log(`Overall fetched ${allItems.length} items`);
```
### Issues
- Closes: #777
0 commit comments