Skip to content

Commit 7f171da

Browse files
committed
[Workers] Fix type parameter for Promise.withResolvers in timers example
1 parent 201fc59 commit 7f171da

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import timers from "node:timers";
2020
export default {
2121
async fetch(): Promise<Response> {
2222
console.log("first");
23-
const { promise: promise1, resolve: resolve1 } = Promise.withResolvers();
24-
const { promise: promise2, resolve: resolve2 } = Promise.withResolvers();
23+
const { promise: promise1, resolve: resolve1 } = Promise.withResolvers<void>();
24+
const { promise: promise2, resolve: resolve2 } = Promise.withResolvers<void>();
2525
timers.setTimeout(() => {
2626
console.log("last");
2727
resolve1();

0 commit comments

Comments
 (0)