rozod
    Preparing search index...

    Function fetchApiPagesGenerator

    • Param Returns Yields Example

      Fetches all pages of results for the given endpoint and parameters. This is a generator function that yields each page as it is fetched.

      endpoint The endpoint to fetch. initialParams The initial parameters to use for the endpoint. requestOptions The options to use when making requests. limit The maximum number of pages to fetch. An array of all results. The next page of results.

      const pages = fetchApiPagesGenerator(getV1badgesicons, { badgeIds: [1, 2, 3] });
      for await (const page of pages) {
      console.log(page.data);
      }

      Type Parameters

      Parameters

      • endpoint: S
      • initialParams: ExtractParams<S>
      • OptionalrequestOptions: RequestOptions<R>
      • limit: number = 1000

      Returns AsyncGenerator<AnyError | ExtractResponse<S>, void, unknown>