Esri/arcgis-rest-js

Improve documentation for nextPage() fuctions

开放

#1,206 创建于 2025年3月18日

 (2 条评论) (1 个反应) (0 位负责人)TypeScript (126 个派生)auto 404
good first issue

仓库指标

星标
 (389 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description

We should update the docs for the various method that support nextPage() function. This means:

We should also document the pattern to paginate thorough resuts to get all results which generally looks like this:

function async getAllResults (response) {
 let allItems = lastResponse.results;

  // Keep getting the next page until there are no more pages.
  while (lastResponse.nextPage) {
    lastResponse = await lastResponse.nextPage();
    allItems = allItems.concat(lastResponse.results);
  }

  return allItems;
}

const allResults = await searchItems(options).then(getAllResults)

Link to page

No response

贡献者指南