Skip to content

Commit

Permalink
fix: explain pager and pageAll sdk param better (#736)
Browse files Browse the repository at this point in the history
Minor code comment change to clarify the `sdk` parameter
  • Loading branch information
jkaster authored Jul 2, 2021
1 parent c821f2b commit a93a9b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/sdk-rtl/src/paging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export type PageObserver<TSuccess> = (

/**
* Create an API response pager for an endpoint that returns a Link header
* @param sdk implementation of IAPIMethods. Can be full SDK or functional auth session
* @param sdk implementation of IAPIMethods. Can be a full SDK or functional auth session. The active transport object is captured from this parameter, which is why it must be passed separately from the paging function.
* @param pageFunc sdk call that includes a paging header
* @param options transport options override to capture and use in paging requests
*
Expand All @@ -189,10 +189,12 @@ export async function pager<TSuccess extends ILength, TError>(

/**
* Create an API response pager and iterate through all pages, calling a page event per page
* @param sdk implementation of IAPIMethods. Can be full SDK object or a functional auth session
* @param sdk implementation of IAPIMethods. Can be a full SDK or functional auth session. The active transport object is captured from this parameter, which is why it must be passed separately from the paging function.
* @param pageFunc sdk call that includes a paging header
* @param onPage observer of the latest page of results. Defaults to noop.
* @param options transport options override to capture and use in paging requests
*
* @remarks `TSuccess` must be a collection type that supports `length`
*/
export async function pageAll<TSuccess extends ILength, TError>(
sdk: IAPIMethods,
Expand Down

0 comments on commit a93a9b1

Please sign in to comment.