Skip to content

Commit 0d5cc11

Browse files
committed
Add async await example
1 parent 22ec561 commit 0d5cc11

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ export class HelloWorld {
1111
return `Hello, this is ${this.foo}`;
1212
}
1313
}
14+
15+
const pause = (ms: number) => new Promise<void>(resolve => setTimeout(resolve, ms));
16+
17+
export async function doSomethingAsync() {
18+
await pause(250);
19+
return 'hello';
20+
}

0 commit comments

Comments
 (0)