HH\Lib\Dict\map_with_key_async

Meta Engineer?

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

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

namespace HH\Lib\Dict;

function map_with_key_async<Tk as arraykey, Tv1, Tv2>(
  KeyedTraversable<Tk, Tv1> $traversable,
  (function(Tk, Tv1): Awaitable<Tv2>) $async_func,
): Awaitable<dict<Tk, Tv2>>;

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

Time complexity: O(n * a), where a is the complexity of each Awaitable Space complexity: O(n)

Parameters

Returns