UNPKG

@microsoft/signalr

Version:
32 lines 1.01 kB
"use strict"; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. Object.defineProperty(exports, "__esModule", { value: true }); exports.AbortController = void 0; // 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 */ 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; } } exports.AbortController = AbortController; //# sourceMappingURL=AbortController.js.map