Skip to content

Commit 656f040

Browse files
committed
[Workers] Fix destructuring of promise resolvers in timers example
1 parent 2f1a370 commit 656f040

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() {
2222
console.log("first");
23-
const { promise1, resolve1 } = Promise.withResolvers();
24-
const { promise2, resolve2 } = Promise.withResolvers();
23+
const { promise: promise1, resolve: resolve1 } = Promise.withResolvers();
24+
const { promise: promise2, resolve: resolve2 } = Promise.withResolvers();
2525
timers.setTimeout(() => {
2626
console.log("last");
2727
resolve1();

0 commit comments

Comments
 (0)