Skip to content

Instantly share code, notes, and snippets.

@Naddiseo
Created November 30, 2017 00:05
Show Gist options
  • Save Naddiseo/93803feab8a6c35a102235631b8d6774 to your computer and use it in GitHub Desktop.
Save Naddiseo/93803feab8a6c35a102235631b8d6774 to your computer and use it in GitHub Desktop.
const getImpl = async () => {
if (__STATICALLY_KNOWN_AT_COMPILE_TIME__) {
return await import('alternate-impl.js').API;
}
return await import('default-impl.js').API;
};
class API {
static async a() {
return (await getImpl()).a();
}
static async b() {
return (await getImpl()).b();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment