单个fetch+async
(async() => {
try {
var response = await fetch(url);
var data = await response.json();
console.log(data);
} catch (e) {
console.log("Booo")
}
})();
如何像$.when一样发起多个请求
$.when(...reqArr).done(function (...data) {
}
类似
requestByFetch(urls)
使用Promise.all
方法就是 Promise.all() , 實作如下.
soonfy