An object with:
value: A read-only reference to the current Abort instance.abort(reason): Aborts the current instance with the given reason, then creates a new one.Example:
const slot = createAbortSlot()
fetch(url, { signal: slot.value.signal })
slot.abort() // aborts current Abort value and prepares a new instance
Creates a reusable abort slot that exposes a read-only
Abortinstance.Each call to
abort()triggers the currentAbortinstance, and then replaces it with a fresh instance for future use. This is useful in systems where cancelable operations are repeatedly started and each one needs its ownAbortsignal.