Skip to content

Instantly share code, notes, and snippets.

@chikoski
Created May 30, 2019 01:17
Show Gist options
  • Save chikoski/c5a0f46d0a22d916e6f996be249e865e to your computer and use it in GitHub Desktop.
Save chikoski/c5a0f46d0a22d916e6f996be249e865e to your computer and use it in GitHub Desktop.
type modA = typeof import('./module-a');
function call(mod: modA) {
const src = 'hello';
const result = mod.id(src);
console.log(`${src} -> ${result}`);
}
async function start() {
console.log('start');
const mod: modA = await import('./module-a');
call(mod);
}
start();
console.log('module a');
export function id(value: string): string {
return value
}
export default {id}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment