Skip to content

Instantly share code, notes, and snippets.

@bcherny
Last active January 10, 2018 23:05
Show Gist options
  • Select an option

  • Save bcherny/b1fac52c789f293fec31ae9662b44ca2 to your computer and use it in GitHub Desktop.

Select an option

Save bcherny/b1fac52c789f293fec31ae9662b44ca2 to your computer and use it in GitHub Desktop.
<?hh
async function seq(vec<(function(): Awaitable<T>)> $as): Awaitable<vec<T>> {
$result = vec[];
foreach ($as as $a) {
$r = await $a();
$result[] = $r;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment