This method is extremely useful for combining multiple signals together. An example would be adding a timeout to a manually aborted signal:
const timeout = AbortSignal.timeout(10000);
const controller = new AbortController();
const signal = AbortSignal.any([timeout, controller.signal]);
// Will abort after 10 seconds, or when controller.abort() is called
await fetch("https://example.org/, { signal });
This PR adds the
AbortSignal.any()
static method.This method is extremely useful for combining multiple signals together. An example would be adding a timeout to a manually aborted signal: