@microsoft/signalr
Version:
ASP.NET Core SignalR Client
28 lines • 863 B
JavaScript
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController
// We don't actually ever use the API being polyfilled, we always use the polyfill because
// it's a very new API right now.
// Not exported from index.
/** @private */
export class AbortController {
constructor() {
this._isAborted = false;
this.onabort = null;
}
abort() {
if (!this._isAborted) {
this._isAborted = true;
if (this.onabort) {
this.onabort();
}
}
}
get signal() {
return this;
}
get aborted() {
return this._isAborted;
}
}
//# sourceMappingURL=AbortController.js.map