bhylu.com

Advertisements

Async AbortControl

AbortController sends a cancellation signal to APIs that support it. The operation must observe the signal to stop.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

const controller = new AbortController();
controller.abort();
console.log(controller.signal.aborted);

What happens

The signal reports true.