HH\Lib\Dict\from_keys_async

Meta Engineer?

This is available as Dict\from_keys_async in the www repository.

Returns a new dict where each value is the result of calling the given async function on the corresponding key

namespace HH\Lib\Dict;

function from_keys_async<Tk as arraykey, Tv>(
  Traversable<Tk> $keys,
  (function(Tk): Awaitable<Tv>) $async_func,
): Awaitable<dict<Tk, Tv>>;

For non-async functions, see Dict\from_keys().

Time complexity: O(n * f), where f is the complexity of $async_func Space complexity: O(n)

Parameters

Returns