-
-
Notifications
You must be signed in to change notification settings - Fork 981
Description
What problem are you trying to solve?
Improve .pagination API (and possibly performance and stability)
Describe the feature
I would humbly suggest the following 2 breaking changes:
- Switch order of
allItemsandcurrentItemsparameters ofpagination.paginate,pagination.filterandpagination.shouldContinue
My reasoning about parameters order is that probably most use cases don't need the allItems parameters, with currentItems typically being more used. To be confirmed by other users, but if indeed currentItems is used more than allItems then it should reflect in the order of parameters.
It doesn't change how the Got code works but could save custom pagination.paginate, pagination.filter and pagination.shouldContinue from having an unused and unaesthetic _ as the second parameter... ;)
- Default value for
stackAllItemtofalse
As per the default of allItems, it implies a waste of CPU and RAM resources when unused. This is especially noticeable when iterating large datasets (and can results in a node.js crash in worst case scenarios)
Checklist
- I have read the documentation and made sure this feature doesn't already exist.