Created
May 30, 2019 01:17
-
-
Save chikoski/c5a0f46d0a22d916e6f996be249e865e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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