使用Promise发送多个异步请求, 全部完成后再执行

const datas = idList
.map(id => url+'/id')
.map(url => fetch(url).then(res => res.json()));
const p = new Promise.all(datas)
.then(data => {...}) const datas = idList
.map(id => url+'/id')
.map(url => fetch(url).then(res => res.json()));
const foo = await Promise.all(datas);
const series = foo.map(data => {...})
上一篇:解决Android Studio Gradle Build特别慢的问题


下一篇:ERROR: dump failed because assets could not be loaded