resolveRecord
Resolves an array of keys into a record by calling an async mapper for each key.
All mapper calls run concurrently via Promise.all.
Unlike parallel, which returns an array, resolveRecord preserves the
key-to-value relationship in the result.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
keys | readonly K[] | The keys to resolve |
mapper | function | Async function called for each key, returning the associated value |
Returns
Section titled “Returns”Promise<Record<K, V>> — A record mapping each key to its resolved value
Examples
Section titled “Examples”Fetch data for multiple keys concurrently
Section titled “Fetch data for multiple keys concurrently”All mapper calls run in parallel via Promise.all.
