HH\Lib\C\first_async
Requires the Hack Standard Library to be installed.
Facebook Engineer?
This function is available as C\gen_first()
in Facebook's www repository.
Returns the first element of the result of the given Awaitable, or null if the Traversable is empty
namespace HH\Lib\C;
function first_async<T>(
Awaitable<Traversable<T>> $awaitable,
): Awaitable<?T>;
For non-Awaitable Traversables, see C\first
.
Time complexity: O(1) Space complexity: O(1)