GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: recommend checking abortSignal.aborted first · nodejs/node@cf4fa79

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • globals.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/globals.md‎

Copy file name to clipboardExpand all lines: doc/api/globals.md
+9-5Lines changed: 9 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ ac.abort();
8989
```
9090

9191
The `AbortController` with which the `AbortSignal` is associated will only
92-
ever trigger the `'abort'` event once. Any event listeners attached to the
93-
`AbortSignal` *should* use the `{ once: true }` option (or, if using the
94-
`EventEmitter` APIs to attach a listener, use the `once()` method) to ensure
95-
that the event listener is removed as soon as the `'abort'` event is handled.
96-
Failure to do so may result in memory leaks.
92+
ever trigger the `'abort'` event once. We recommended that code check
93+
that the `abortSignal.aborted` attribute is `false` before adding an `'abort'`
94+
event listener.
95+
96+
Any event listeners attached to the `AbortSignal` should use the
97+
`{ once: true }` option (or, if using the `EventEmitter` APIs to attach a
98+
listener, use the `once()` method) to ensure that the event listener is
99+
removed as soon as the `'abort'` event is handled. Failure to do so may
100+
result in memory leaks.
97101

98102
#### `abortSignal.aborted`
99103
<!-- YAML

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.