C
AbortController
History
Added in: v15.0.0, v14.17.0
v15.0.0, v14.17.0
Introduced in: v0.10.0
v0.10.0
No longer experimental.
v15.4.0
A utility class used to signal cancelation in selected Promise-based APIs.
The API is based on the Web API AbortController.
const ac = new AbortController(); ac.signal.addEventListener('abort', () => console.log('Aborted!'), { once: true }); ac.abort(); console.log(ac.signal.aborted); // Prints true
M
abort
History
Added in: v15.0.0, v14.17.0
v15.0.0, v14.17.0
Added the new optional reason argument.
v17.2.0, v16.14.0
abort(reason?): void
Attributes
reason:
anyAn optional reason, retrievable on the
AbortSignal's
reason property.Triggers the abort signal, causing the abortController.signal to emit
the 'abort' event.
Type:
AbortSignal