Await dictionary

Specification
Proposal repo

Modules

esnext.promise.all-keyed, esnext.promise.all-settled-keyed.

Built-ins signatures

class Promise {
  static allKeyed(obj: Record<string | symbol, any>): Promise<Record<string | symbol, any>>;
  static allSettledKeyed(obj: Record<string | symbol, any>): Promise<Record<string | symbol, { status: 'fulfilled', value: any } | { status: 'rejected', reason: any }>>;
}

Entry points

core-js/proposals/await-dictionary
core-js(-pure)/actual|full/promise/all-keyed
core-js(-pure)/actual|full/promise/all-settled-keyed

Examples

await Promise.allKeyed({
  a: Promise.resolve(1),
  b: Promise.resolve(2),
  c: 3,
}); // => { a: 1, b: 2, c: 3 }

await Promise.allSettledKeyed({
  a: Promise.resolve(1),
  b: Promise.reject(2),
  c: 3,
}); // => { a: { status: "fulfilled", value: 1 }, b: { status: "rejected", reason: 2 }, c: { status: "fulfilled", value: 3 } }