Similar to AbortSignal.any
except the returned promise has a .clear method that removes all event
listeners added to passed signals preventing memory leaks.
At the time of writing at least, AbortSignal.any leaks memory in Node.js
and Deno environments:
try { // The user or the timeout can now abort the action awaitperformSomeAction({ signal:combinedSignal }) } finally { // Clear will clean up internal event handlers combinedSignal.clear() }
Similar to AbortSignal.any except the returned promise has a
.clearmethod that removes all event listeners added to passed signals preventing memory leaks.At the time of writing at least,
AbortSignal.anyleaks memory in Node.js and Deno environments:Example