> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# allKeyed es-toolkit

Resolves an object of promises concurrently, returning an object with the same keys and resolved values.

```typescript
// a is the async result of doA(), b is the async result of doB()
const { a, b } = await allKeyed({ a: doA(), b: doB() });
```

## Usage

### `allKeyed(tasks)`

Use `allKeyed` when you want to run multiple promises in parallel and access results by name instead of positional indices. Similar to `Promise.all`, but accepts an object of promises and preserves keys in the result.

Based on the [TC39 `Promise.allKeyed` proposal](https://github.com/tc39/proposal-await-dictionary).

```typescript
import { allKeyed } from 'es-toolkit/promise';

const { user, posts } = await allKeyed({
  user: fetchUser(),
  posts: fetchPosts(),
});
```

Plain values are also supported alongside promises.

```typescript
const result = await allKeyed({
  a: Promise.resolve(1),
  b: 2,
});
// { a: 1, b: 2 }
```

It's also useful when you want to fetch multiple resources in parallel without worrying about array ordering.

```typescript
// With Promise.all, swapping the order silently breaks destructuring:
// const [user, posts] = await Promise.all([fetchUser(), fetchPosts()]);

// With allKeyed, keys are explicit — no ordering bugs:
const { user, posts } = await allKeyed({
  user: fetchUser(),
  posts: fetchPosts(),
});
```

#### Parameters


tasksTrequired

An object whose values are promises (or plain values) to resolve concurrently.

#### Returns

A promise that resolves to an object with the same keys and resolved values.

```typescript
Promise<{ [K in keyof T]: Awaited<T[K]> }>
```


Source: es-toolkit

Re-exported verbatim from [`es-toolkit`](https://es-toolkit.dev/reference/promise/allKeyed.html). Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.
