Re: [whatwg/dom] Creating an already aborted AbortController (#959)

The most recent use case I've seen this for is the easiest/clearest... It's in the context of an HTTP request in Node.js:

1. An `AbortController`/`AbortSignal` is associated with an HTTP request.
2. The `AbortController`/`AbortSignal` is lazily created (that is, it is only created the first time it is explicitly asked for)
3. The HTTP request may already be aborted by the time the `AbortController`/`AbortSignal` is requested, in which case we want to just return an already aborted signal as opposed to `undefined` or throwing.

Very simple, and along the same lines as (for instance) `Promise.reject()`.

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

Received on Tuesday, 9 March 2021 18:57:26 UTC