-
Notifications
You must be signed in to change notification settings - Fork 232
Page iterator Implementation #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should support DeltaLink as part of the pageIterator as it uses nextLink to perform the paging until the changes are sync'd
lib/src/tasks/PageIterator.d.ts
Outdated
* Iterates over a collection by enqueuing entries one by one and kicking the callback with the enqueued entry | ||
* @return A boolean indicating the continue flag to process next page | ||
*/ | ||
iterationHelper(): boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think iterationHelper is supposed to be private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in the spec as private, but I missed in the implementation. will change
lib/src/tasks/PageIterator.d.ts
Outdated
iterate(): Promise<any>; | ||
/** | ||
* @async | ||
* This internally calls the iterate method, Its juts for more readability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it's just
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change
@MIchaelMainer Have done the changes that you are requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
PageIterator
For a variety of reasons, collections of entities are often split into pages and each page is returned with a URL to the next page. Sometimes, page granularity provided by the API does not match the requirements of the consumer. This task aims to simplify the life of consumers of paged collections.
Iterate over all the messages
Stopping and Resuming the iteration