Skip to content

Commit 6a93d53

Browse files
committed
[Workers] Tweak code sample in timers document
1 parent 656f040 commit 6a93d53

File tree

1 file changed

+3
-5
lines changed
  • src/content/docs/workers/runtime-apis/nodejs

1 file changed

+3
-5
lines changed

src/content/docs/workers/runtime-apis/nodejs/timers.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and [`setImmediate`](https://nodejs.org/api/timers.html#setimmediatecallback-arg
1818
import timers from "node:timers";
1919

2020
export default {
21-
async fetch() {
21+
async fetch(): Promise<Response> {
2222
console.log("first");
2323
const { promise: promise1, resolve: resolve1 } = Promise.withResolvers();
2424
const { promise: promise2, resolve: resolve2 } = Promise.withResolvers();
@@ -35,10 +35,8 @@ export default {
3535
await Promise.all([promise1, promise2]);
3636

3737
return new Response("ok");
38-
39-
}
40-
}
41-
38+
}
39+
} satisfies ExportedHandler<Env>;
4240
```
4341
</TypeScriptExample>
4442

0 commit comments

Comments
 (0)