Skip to content

Commit 4cce4de

Browse files
committed
Fix docs being out of sync from #1645
1 parent 462bc63 commit 4cce4de

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

readme.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,9 @@ Default: `false`
10261026

10271027
Defines how the property `allItems` in [`pagination.paginate`](#pagination.paginate), [`pagination.filter`](#pagination.filter) and [`pagination.shouldContinue`](#pagination.shouldContinue) is managed.
10281028

1029-
When set to `false`, the `allItems` parameter is always an empty array. If `true`, it can hugely increase memory usage when working with a large dataset.
1029+
By default, the property `allItems` is always an empty array. This setting can be helpful to save on memory usage when working with a large dataset.
10301030

1031+
When set to `true`, the property `allItems` is an array of the emitted items.
10311032

10321033
##### localAddress
10331034

source/as-promise/types.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ export interface PaginationOptions<ElementType, BodyType> {
4747
The function takes an object with the following properties:
4848
- `response` - The current response object.
4949
- `currentItems` - Items from the current response.
50-
- `allItems` - An empty array, unless when `pagination.stackAllItems` is set to `true`. In the later case, an array of the emitted items.
50+
- `allItems` - An empty array, unless `pagination.stackAllItems` is set to `true`, in which case, it's an array of the emitted items.
5151
52-
It should return an object representing Got options pointing to the next page.
53-
The options are merged automatically with the previous request, therefore the options returned `pagination.paginate(...)` must reflect changes only.
54-
If there are no more pages, `false` should be returned.
52+
It should return an object representing Got options pointing to the next page. The options are merged automatically with the previous request, therefore the options returned `pagination.paginate(...)` must reflect changes only. If there are no more pages, `false` should be returned.
5553
5654
@example
5755
```
@@ -126,11 +124,13 @@ export interface PaginationOptions<ElementType, BodyType> {
126124
requestLimit?: number;
127125

128126
/**
129-
Defines how the property `allItems` in pagination.paginate, pagination.filter and pagination.shouldContinue is managed.
127+
Defines how the property `allItems` in `pagination.paginate`, `pagination.filter` and `pagination.shouldContinue` is managed.
130128
131129
By default, the property `allItems` is always an empty array. This setting can be helpful to save on memory usage when working with a large dataset.
132130
133131
When set to `true`, the property `allItems` is an array of the emitted items.
132+
133+
@default false
134134
*/
135135
stackAllItems?: boolean;
136136
};

0 commit comments

Comments
 (0)