Created
August 4, 2023 03:56
-
-
Save iugo/ed2af1a4b9d3c17961ddc6166c5b7b47 to your computer and use it in GitHub Desktop.
import and global await
This file contains 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
// deno run tools/test/main.ts | |
import { mod1 } from './mod1.ts'; | |
import { mod2 } from './mod2.ts'; | |
console.log('begin main'); | |
mod1(); | |
mod2(); |
This file contains 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
import { delay } from 'https://deno.land/std@0.167.0/async/delay.ts'; | |
console.log('load mod1'); | |
await delay(1000); | |
console.log('delay mod1 1000ms'); | |
export function mod1() {} |
This file contains 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
import { delay } from 'https://deno.land/std@0.167.0/async/delay.ts'; | |
console.log('load mod2'); | |
await delay(500); | |
console.log('delay mod2 500ms'); | |
await delay(1500); | |
console.log('delay mod2 1500ms'); | |
export function mod2() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the console will print: