rozod
    Preparing search index...

    Function fetchApiSplit

    • Param Returns Example

      Fetches the data from the given endpoint, but splits the request into multiple requests if the specified parameter is larger than max specified.

      endpoint The endpoint to fetch from. params The parameters to pass to the endpoint. max The maximum number of items to pass to the endpoint. transform A function that accepts the endpoint response and transforms it into the desired type. requestOptions Any additional options to pass to fetch. The transformed response from the endpoint.

      const data = await fetchApiSplit(getV1gamesicons, { universeIds: [1, 2, 3, 4, 5] }, { universeIds: 100 }, (response) => response.data);
      console.log(data); // [[{ "targetId": 0, "state": "Completed", "imageUrl": "..." }], ...]

      Type Parameters

      Parameters

      • endpoint: S
      • params: ExtractParams<S>
      • Optionalmax: Partial<{ [K in string | number | symbol]: number }>
      • transform: (response: ExtractResponse<S>) => T = ...
      • OptionalrequestOptions: RequestOptions<boolean>

      Returns Promise<AnyError | T[]>