Slide 18
Slide 18 text
JS/TS Ͱ Promise Λ׆༻ͯ͠ฒߦʹ࣮ߦ
// TypeScript
async function fetchUser(...): Promise {
const userPromise = downloadData(...);
const avatarPromise = downloadData(...);
const [userData, avatarData]
= await Promise.all([userPromise, avatarPromise]);
...
return user;
}
await ͠ͳ͍͜ͱ͕ՄೳͩͱෳͷඇಉظॲཧΛฒߦʹ࣮ߦͰ͖
Δɻ