AbortSignal class

The AbortSignal can be send with expensive calls so that they can be canceled early.

See:

Annotations
  • @JS("window.AbortSignal")

Constructors

AbortSignal.new()

Properties

aborted bool
If the signal has been aborted
no setter
hashCode int
The hash code for this object.
no setterinherited
onabort ↔ void Function(dynamic)
An event fired when the signal gets aborted.
getter/setter pair
reason → dynamic
The reason why the signal has been aborted. This can be an Error, but also a string or any other Object you may want.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
throwIfAborted() → void
Throw the object that is in reason as if it was an Error. In JS you are allowed to throw what ever you want and it doesn't have to be an Error type.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

abort([dynamic reason]) AbortSignal
Create a new abort signal that has already been aborted. The reason can be an Error, but also a string or any other Object you may want.
timeout(int milliseconds) AbortSignal
Create a new AbortSignal that will automatically abort after the timeout in milliseconds.