Re: [whatwg/dom] Consider adding a timeout parameter to the AbortController constructor (Issue #1110)

I think @bathos' comment is addressed with the addition of `AbortSignal.any()`. Perhaps we need more compositional methods, but those would be best tracked in their own issue.

@adixon-adobe `AbortSignal` doesn't have a `timeout()` instance method though. It has a static method that vends an `AbortSignal()`. That's quite different. Is it the presentation on MDN that makes this confusing?

I guess there's a question of whether there's room for a static that does something like the following
```js
function controllerWithTimeout(timeout) {
  const controller = new AbortController();
  const timeoutSignal = AbortSignal.timeout(timeout);
  const signal = AbortSignal.any([controller.signal, timeoutSignal]);
  return { controller, signal };
}
```
and is perhaps a bit cleaner/magical (by flattening `signal` into `controller`), but I tend to agree with @domenic that there needs to be more evidence of need before we go there.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1110#issuecomment-1551320534
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1110/1551320534@github.com>

Received on Wednesday, 17 May 2023 12:40:42 UTC