· 6 min read
Promise.allKeyed: await an object of promises in JavaScript
Promise.allKeyed works like Promise.all but takes an object, so results come back by name. How it works, allSettledKeyed, and how to use it today.

Promise.allKeyed() is a new JavaScript method that works like Promise.all(), but takes an object of promises instead of an array and resolves to an object with the same keys. You read results by name, not by position. It comes with a sibling, Promise.allSettledKeyed(), and both shipped in Firefox 155 in September 2026 as part of the Stage 3 TC39 "await dictionary" proposal.
If you have ever lined up three requests in a Promise.all array and then destructured the result in the same order, you already know the problem this solves.
What problem does Promise.allKeyed solve?
Promise.all is positional. You pass an array, you get an array back, and the only link between a request and its result is its index:
const [user, posts, settings] = await Promise.all([
getUser(id),
getPosts(id),
getSettings(id),
]);
That is fine with three items. It gets fragile when the list grows, when someone reorders the array, or when a request is added conditionally. Swap two lines in the array and forget to swap the destructuring, and posts silently holds the settings object. Nothing throws. The types might even line up if both are plain objects.
With Promise.allKeyed, the name travels with the promise:
const { user, posts, settings } = await Promise.allKeyed({
user: getUser(id),
posts: getPosts(id),
settings: getSettings(id),
});
Order no longer matters. Adding a fourth request is one new line, and the destructuring picks it up by name. The requests still run concurrently, exactly as they would with Promise.all. If you want a refresher on why concurrency here depends on starting every promise before awaiting any of them, see why await inside forEach doesn't wait.
How does Promise.allKeyed work?
The behavior mirrors Promise.all, with objects in place of arrays:
- It fulfills once every value in the object has fulfilled, with an object mapping each key to its result.
- It rejects as soon as any promise rejects, with that first rejection reason. The other promises keep running, but their results are discarded.
- Values that are not promises are passed through as-is. Any thenable, meaning an object with a
thenmethod, is awaited like a promise. - An empty object resolves to an empty object.
A few details come straight from the specification and are worth knowing.
Only own, enumerable keys count. The method reads the object's own property keys and skips anything non-enumerable. Inherited properties on the prototype chain are ignored, the same rule Object.keys uses.
Symbol keys are included. This is where it differs from most userland helpers, which use Object.keys and drop symbols. An enumerable symbol-keyed property is awaited and appears in the result.
Key order is preserved. The result has its keys in the same order as the input.
Nested objects are not traversed. A plain object as a value is treated as an already-resolved value. Promises inside it are not awaited.
const r = await Promise.allKeyed({
count: 42,
user: fetchUser(),
meta: { inner: fetchMeta() }, // not awaited; returned as-is
});
// r.meta.inner is still a pending promise
A non-object argument rejects. Passing null or a number does not throw synchronously. The returned promise rejects with a TypeError, so a try/catch around await handles it like any other failure.
What does the result object look like?
One detail catches people out: the result object has a null prototype. A null-prototype object is one created with no Object.prototype behind it, so it has no inherited methods at all.
That is a deliberate choice. Keys from your input can never collide with or shadow built-in names like toString or constructor. Most everyday code will not notice the difference. Destructuring, property access, spreading and JSON.stringify all work normally:
const r = await Promise.allKeyed({ a: 1, b: Promise.resolve(2) });
const { a, b } = r; // 1, 2
JSON.stringify(r); // '{"a":1,"b":2}'
Object.hasOwn(r, "a"); // true
r.hasOwnProperty; // undefined
String(r); // TypeError: no toString to call
If you pass the result to code that calls obj.hasOwnProperty(...) or relies on implicit string conversion, spread it into a regular object first: { ...r }.
How is allSettledKeyed different?
Promise.allSettledKeyed() is the keyed version of Promise.allSettled(). It never rejects because one input failed. It waits for every promise to settle and gives you a record for each key:
const results = await Promise.allSettledKeyed({
profile: getProfile(id),
avatar: getAvatar(id),
});
if (results.avatar.status === "rejected") {
console.warn("avatar failed:", results.avatar.reason);
}
Each entry has status set to "fulfilled" with a value, or "rejected" with a reason. That shape is identical to allSettled, so existing handling code transfers directly. The outer object has a null prototype; the per-key records are ordinary objects.
Use this one for dashboards and pages that should render whatever loaded, where one failed widget should not blank the whole screen.
| Method | Input | Rejects when | Result |
|---|---|---|---|
Promise.all | iterable | any input rejects | array, by position |
Promise.allKeyed | object | any input rejects | object, by key |
Promise.allSettled | iterable | never | array of status records |
Promise.allSettledKeyed | object | never | object of status records |
Can you use Promise.allKeyed today?
Firefox 155, released September 1, 2026, is the first stable browser to ship both methods. The proposal is at Stage 3 in TC39, which means the design is considered complete and engines are implementing it. Check current compatibility data for other browsers and for your server runtime before relying on it unguarded.
In the meantime, the polyfill route is mature. core-js includes both methods from version 3.50.0, and es-shims publishes a standalone promise.allkeyed package. A feature check keeps the native version where it exists:
if (typeof Promise.allKeyed !== "function") {
await import("core-js/actual/promise/all-keyed");
}
If you prefer not to add a dependency, a small helper covers most cases. It is not spec-exact, but it keeps the same key rules:
async function allKeyed(obj) {
const keys = Reflect.ownKeys(obj).filter((k) =>
Object.prototype.propertyIsEnumerable.call(obj, k)
);
const values = await Promise.all(keys.map((k) => obj[k]));
const out = Object.create(null);
keys.forEach((k, i) => (out[k] = values[i]));
return out;
}
On the TypeScript side, an issue tracks adding the methods to the esnext lib, with TypeScript 7.1 named as the target. Until it lands in your version, you may need a small declaration file for the types.
Key takeaways
Promise.allKeyed()isPromise.all()for objects: same concurrency, same fail-fast rejection, results by name.Promise.allSettledKeyed()is the keyedallSettled(): it never rejects and returns a status record per key.- Only own enumerable keys are used, symbols included, and nested objects are not awaited.
- The result has a null prototype, so use
Object.hasOwnor spread it if other code expectsObject.prototypemethods. - Firefox 155 ships it natively; use core-js or a feature-detected fallback elsewhere.
FAQ
Is Promise.allKeyed faster than Promise.all?
No. It schedules the same work and waits the same way. The benefit is readability and safety: results are matched to requests by name, so reordering code cannot mix them up.
Does Promise.allKeyed accept a Map?
It accepts any object, but it reads the object's own enumerable properties, not Map entries. A Map stores its entries internally, so passing one gives you an empty result. Convert it with Object.fromEntries(map) first.
What happens to the other promises when one rejects?
They keep running, because promises cannot be cancelled. Their results are simply ignored. If you need to stop the work, pass an AbortSignal to each request and abort it in your catch.