AbortController Projects .

Technology

AbortController

A JavaScript utility for signaling cancellation: it generates an `AbortSignal` to terminate one or more asynchronous tasks, like `fetch` or streams.

The `AbortController` is your command center for asynchronous operation control. You instantiate a new `AbortController`, then extract its read-only `signal` property. This `signal` is passed into the options object of any abortable API, such as a `fetch` request or an `addEventListener` call. To execute the cancellation command, call the `controller.abort()` method: this triggers the signal, causing the linked operation to stop immediately. For `fetch`, this action rejects the Promise with a specific `AbortError` DOMException, allowing for clean, efficient resource cleanup and preventing unnecessary network traffic.

https://developer.mozilla.org/en-US/docs/Web/API/AbortController
1 project · 1 city

Related technologies

Recent Talks & Demos

Showing 1-1 of 1

Members-Only

Sign in to see who built these projects