class AbortController

Supported only in the v8 engine. Introduced in Max v9.2.0.

Creates an AbortSignal and the means to abort it.

Example

const controller = new AbortController();
setTimeout(() => controller.abort(), 1000);
fetch("https://example.com/slow", { signal: controller.signal }).catch((err) =>
  post("aborted:", err.message, "\n"),
);

Index

Constructors

Properties

Methods

new AbortController()

new AbortController();

Constructs a new instance of the AbortController class

abort(reason)

Aborts associated operations and marks AbortController.signal as aborted.

abort(reason?: any): void;
NameTypeDescription
optional reasonanyan optional abort reason

signal AbortSignal read-only

The signal to pass to abortable operations.