facebook/flow

Top-level await

Opened this issue · 1 comments

Proposal

https://github.com/tc39/proposal-top-level-await

Use case

// awaiting.mjs
import { process } from "./some-module.mjs";
const dynamic = import(computedModuleSpecifier);
const data = fetch(url);
export const output = process((await dynamic).default, await data);

this is available in nodejs! looking forward to flow supporting it