我从 DigitalOcean API 获得了一个液滴列表,但液滴列表是每页的。
响应为您提供页面上和下一页上的液滴列表...
我试图递归地获取每个承诺的下一页:
getDropletsPerPage(command,firstPage).then((response)=>{
nextPage= response['nextPage']
droplets= response['droplets']
getDropletsPerPage(command, nextPage).then((response)=>{
nextPage= response['nextPage']
droplets= response['droplets']
getDropletsPerPage(command, nextPage).then((response)=>{
nextPage= response['nextPage']
droplets= response['droplets']
// Repeat until last page..
})
})
})
繁花不似锦
哔哔one
慕森王
相关分类