Mobafire LoL Builds

부분 유료
분류별 Slimjim2448 | 업데이트됨 2 months ago | Gaming
인기

0.3 / 10

지연 시간

805ms

서비스 수준

0%

Health Check

N/A

모든 토론으로 돌아가기

Result grows after each GET

Rapid account: Abrowncownow
abrowncownow
2 years ago

I was just testing this on a basic level. Each time I run the fetch request, my array grows. it started with <200 results and now I’m over 5000. It isn’t a local problem, because when I change the variable, the result is the same (huge fetch return). How/Why am I getting a larger request each time. I would like the id-list data that I pull to remain the same .length
Here is my very simple code:

const options = {
    method: "GET",
    headers: {
        "X-RapidAPI-Key": "{myapikey}",
        "X-RapidAPI-Host": "mobafire-lol-builds.p.rapidapi.com",
    },
};

var ChampId = [];
function getChampList(){
    fetch(
        "https://mobafire-lol-builds.p.rapidapi.com/api/champions/id-list",
        options
    )
        .then((response) => response.json())
        .then(function (data) {            
            ChampId = data;
						 // Use the console to examine the response
            console.log(ChampId);
        });
}

getChampList();

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입