Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 2.46 KB

modules.md

File metadata and controls

84 lines (56 loc) · 2.46 KB

@clickup/rest-client / Exports

@clickup/rest-client

Classes

Interfaces

Functions

depaginate

depaginate<TItem, TCursor>(readFunc): AsyncGenerator<TItem, void, undefined>

Keeps calling a function with an updating cursor, and depaginates all the results until the cursor returned is null or undefined.

On each call, the inner function needs to return an array with two elements:

  1. Array or results, which could be empty, but not null or undefined.
  2. A new cursor.

Type parameters

Name Type
TItem TItem
TCursor string

Parameters

Name Type
readFunc (cursor: undefined | TCursor) => Promise<readonly [TItem[], undefined | null | TCursor]>

Returns

AsyncGenerator<TItem, void, undefined>

Defined in

src/helpers/depaginate.ts:9


paceRequests

paceRequests(pacer, delayMetric?): Middleware

Rest Client middleware that adds some delay between requests using one of Pacer implementations.

Parameters

Name Type
pacer null | Pacer | (req: RestRequest<any>) => Promise<null | Pacer>
delayMetric? (delay: number, reason: string) => void

Returns

Middleware

Defined in

src/middlewares/paceRequests.ts:33