TypeScriptPromise/asyncPromise.all

Returns a promise that fulfills when all input promises fulfill.

문법

Promise.all(promises): Promise<T[]>

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

const
users
posts
await
Promise
fetchUsers
fetchPosts
const [users, posts] = await Promise.all([
  fetchUsers(),
  fetchPosts(),
]);