Asynchronous generator function that iterates over documents.

If the response length is greater than the specified limit.

  • Type Parameters

    Parameters

    • config: IConfig<Data>

      The configuration object.

      • totalDocuments

        The total number of documents to iterate over.

      • limit

        The number of documents to fetch in each request.

      • delay

        The delay between each request.

      • createRequest

        The function used to create the request.

    Returns AsyncGenerator<Data[], void, unknown>

    An asynchronous generator that yields an array of documents.