Skip to content
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

feat: add page iterator #353

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: add page iterator #353

wants to merge 13 commits into from

Conversation

rkodev
Copy link
Contributor

@rkodev rkodev commented Feb 14, 2025

Resolves #6

@rkodev rkodev marked this pull request as ready for review February 18, 2025 15:04
@rkodev rkodev requested a review from a team as a code owner February 18, 2025 15:04
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some unit tests so the basic stuff is covered please?

* @enum
* Enum representing the state of the iterator
*/
export enum PagingState {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend against using enums since they are slowly going away and some ts configurations /deno/etc... now prohibit them. How about a union of string values instead?

* @class
* Class for PageIterator
*/
export class PageIterator<T extends Parsable, C extends Parsable> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc comments for the type parameters

const requestInformation = new RequestInformation();
requestInformation.httpMethod = HttpMethod.GET;
requestInformation.urlTemplate = this.getOdataNextLink();
requestInformation.headers.addAll(this.headers);
if (this.options) {
if (this.options.headers) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the this.headers property now that you have this here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for page iterator
3 participants