Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
382 B
0
Indexable
Never
function parallelHttpRequests(urls, limit, callback) {
  
  if(!urls.length){
      return
  }
  
    const arrayResponse = []
    let limitCount = 0
    
    const getData = (index) =>{ 
        const urlResponse = axios.get(urls[index]).then((res)=>{
            arrayResponse[index] = res.data
            ++limitCount
            getData(index + 1)     
        })
    } 
    
}
Leave a Comment