Web APIs
AbortSignal
Object conveying cancellation state and reason, with an abort event. Signals can be shared with operations that accept them. An aborted signal does not reset.
Formal Syntax & Structure
javascript syntaxjavascript
controller.signalWorking Example
Example Snippetjavascript
const c = new AbortController();c.signal.addEventListener("abort", () => console.log(c.signal.reason), {once:true});c.abort("stop"); c.abort("again");console.log(c.signal.aborted);