# code-block-pro/1.27.7/build/shiki/samples/hack.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.27.7. 24 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/build/shiki/samples/hack.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.27.7/raw/build/shiki/samples/hack.sample
- Modified: 2023-09-03T01:04:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/build/shiki/samples/hack.sample#L10-L20`.

```
<<__EntryPoint>>
async function my_example(): Awaitable<void> {
  $user_ids = vec[1, 2, 3];

  // Initiate all the database requests together,
  // so we spend less time waiting.
  $user_names = await Vec\map_async(
    $user_ids,
    async ($id) ==> await fetch_user_name($id),
  );
  // Execution continues after requests complete.

  echo Str\join($user_names, ", ");
}

async function fetch_user_name(
  int $_,
): Awaitable<string> {
  // This could be a database request.
  return "";
}

// From hacklang.org

```
