@mywebapi.com/sdk - v0.1.0
    Preparing search index...

    Function paginate

    • Walk a cursor-paged endpoint as an async iterable, yielding one page of items at a time.

      Type Parameters

      • T

      Parameters

      • fetchPage: (cursor: string | undefined) => Promise<PagedResult<T>>

      Returns AsyncIterable<T[]>

      for await (const page of paginate((cursor) => client.paged(() =>
      client.mt4.getUserRecordsRequest('my-tp', { cursor })
      ))) {
      process(page);
      }