@grepvine/sdk
    Preparing search index...

    Function paginate

    • Every item of a list or search method, page after page.

      method is any method that returns a page, such as client.indexes.list or client.search.query, and parameters are its parameters. The pages are fetched as the loop needs them, following pagination.next_page_id while has_next is true; a page may be empty while more follow. amount sets the size of each page and page the page to start from.

      for await (const index of paginate(client.indexes.list, { organization: "acme" })) {
      console.log(index.name, index.state);
      }

      Type Parameters

      Parameters

      • method: M
      • parameters: Parameters<M>[0]
      • Optionaloptions: { signal?: AbortSignal }

      Returns AsyncGenerator<PageItem<M>, void, undefined>