Used to notify observers when AbortController.abort() is called.

Extends js.node.web.EventTarget. Prefer these Node web externs over the incomplete Haxe standard library js.html.AbortSignal.

See also:

Static methods

staticabort(?reason:Any):AbortSignal

Returns a new already aborted AbortSignal.

staticany(signals:Array<AbortSignal>):AbortSignal

Returns a new AbortSignal which will be aborted if any of the provided signals are aborted. Its reason will be set to whichever signal caused the abort.

statictimeout(delay:Float):AbortSignal

Returns a new AbortSignal which will be aborted in delay milliseconds.

Variables

read onlyaborted:Bool

True after the associated AbortController has been aborted.

onabort:Null<Event ‑> Void>

An optional callback function that may be set by user code to be notified when AbortController.abort() has been called.

read onlyreason:Any

An optional reason specified when the AbortSignal was triggered.

Methods

throwIfAborted():Void

If aborted is true, throws reason.

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>):Void

Adds a new handler for the type event. Any given listener is added only once per type and per capture option value.

dispatchEvent(event:Event):Bool

Dispatches the event to the list of handlers for event.type.

Returns:

true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, otherwise false.

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes the listener from the list of handlers for event type.