From b03272b9a1a8b9bd87b7549ff74f5fe18fbc424b Mon Sep 17 00:00:00 2001 From: Ivo Janssen Date: Wed, 9 Oct 2024 00:32:00 -0700 Subject: [PATCH] doc: fix `events.once()` example using `AbortSignal` PR-URL: https://github.com/nodejs/node/pull/55144 Reviewed-By: James M Snell Reviewed-By: Jake Yuesong Li --- doc/api/events.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index 1addeb123f4ed3..17688859a58d1f 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1459,8 +1459,7 @@ async function foo(emitter, event, signal) { } foo(ee, 'foo', ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit('foo'); // Prints: Waiting for the event was canceled! +ac.abort(); // Prints: Waiting for the event was canceled! ``` ```cjs @@ -1483,8 +1482,7 @@ async function foo(emitter, event, signal) { } foo(ee, 'foo', ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit('foo'); // Prints: Waiting for the event was canceled! +ac.abort(); // Prints: Waiting for the event was canceled! ``` ### Awaiting multiple events emitted on `process.nextTick()`