[Javascript] Cancel A Promise Using AbortController
The AbortController interface enables us to cancel a one or more DOM requests. In this lesson, we will demonstrate how to use the controller to cancel a Javascript Promise before it is resolved.
const controller = new AbortController(); const signal = controller.signal;
The controller only has one method:
controller.abort();
When you do this, it notifies the signal: