• Type Parameters

    • Item

    • Arg

    • Response

    Parameters

    • props: {
          arg: Arg;
          haveEnoughItems?: ((items: Item[]) => boolean);
          paginationOptions?: PaginationOptions;
          request: ((arg: Arg, pagination: PaginationOptions) => Promise<Response[]>);
          responseTranslator?: ((response: Response[], arg: Arg) => Item[]);
      }
      • arg: Arg
      • Optional haveEnoughItems?: ((items: Item[]) => boolean)
          • (items: Item[]): boolean
          • Returns

            true to indicate that current result set should be returned

            Parameters

            • items: Item[]

            Returns boolean

      • Optional paginationOptions?: PaginationOptions
      • request: ((arg: Arg, pagination: PaginationOptions) => Promise<Response[]>)
          • (arg: Arg, pagination: PaginationOptions): Promise<Response[]>
          • Parameters

            • arg: Arg
            • pagination: PaginationOptions

            Returns Promise<Response[]>

      • Optional responseTranslator?: ((response: Response[], arg: Arg) => Item[])
          • (response: Response[], arg: Arg): Item[]
          • Parameters

            • response: Response[]
            • arg: Arg

            Returns Item[]

    • page: number = 1
    • accumulated: Item[] = []

    Returns Promise<Item[]>

Generated using TypeDoc