File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,15 @@ ac.abort();
8989```
9090
9191The ` 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
You can’t perform that action at this time.
0 commit comments