HH\Asio\mfk

Returns an Awaitable of Map after a filtering operation has been applied to each key and value in the provided KeyedTraversable

namespace HH\Asio;

function mfk<Tk, Tv>(
    KeyedTraversable<Tk, Tv> $inputs,
  (function(Tk,Tv):Awaitable<bool>) $callable,
): Awaitable<Map<Tk, Tv>>;

This function is similar to mf(), but passes element keys to the callable as well.

This function is similar to Map::filterWithKey(), but the filtering of the keys and values is done using Awaitables.

This function is called mfk because we are returning a map, doing a a filtering operation that includes keys.

$callable must return an Awaitable of bool.

The keys and values in the Map of the returned Awaitable are not available until you await or join the returned Awaitable.

Parameters

Return Values