@jiminp/tooltool
    Preparing search index...

    Function fetchPages

    • Fetches pages as an async generator, yielding each non-nullish page with its index.

      Wrapper around forEachPage. Pages may yield out-of-order due to parallel fetching.

      Type Parameters

      • Page

        The page data type.

      Parameters

      Returns AsyncGenerator<{ index: number; page: NonNullable<Page> }>

      { page, index } for each non-nullish page.

      If any fetch fails.

      for await (const { page, index } of fetchPages(fetcher)) {
      console.log(`Page ${index}:`, page);
      }

      forEachPage for a callback-based alternative.