-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[cli] Add client.fetchPaginated()
async iterator
#10054
Conversation
Adds async iterator helper function for interacting with endpoints that have pagination. Implemented for use with `vc bisect` (fetching deployments) and `vc link --repo` (fetching projects).
🦋 Changeset detectedLatest commit: 323f21e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
internals/types/index.d.ts
Outdated
@@ -383,7 +383,7 @@ export interface ProjectLink { | |||
export interface PaginationOptions { | |||
prev: number; | |||
count: number; | |||
next?: number; | |||
next?: number | null; |
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.
question (non-blocking): Is there some type shuffling we can do to make this not both null
and undefined
?
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.
From what I've seen so far I think the API will always return null
. Will double check on that though.
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 could wrap it to get rid of one of the types. It's not a huge deal, but I do like simplifying these when they come up. I don't want to read the type later and wonder what the difference between undefined
and null
means for this property.
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.
Updated to use the same type as defined in API repo
166ae0c
Adds async iterator helper function for interacting with endpoints that have pagination.
Implemented for use with
vc bisect
(fetching deployments) andvc link --repo
(fetching projects).