Puan
0
Çözümler
0
Kod:
async function getData() {
try {
const r = await fetch(url);
return await r.json();
} catch(err) {
console.error(err);
}
}
// Paralel istekler
const [users, posts] = await Promise.all([
fetch("/api/users").then(r => r.json()),
fetch("/api/posts").then(r => r.json()),
]);
