This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import { AbortSignal } from "./AbortSignal";
export class AbortController {
constructor() {
this.signal = new AbortSignal();
}
abort() {
this.signal.abort();
}
}

View File

@@ -0,0 +1,20 @@
export class AbortSignal {
constructor() {
this.onabort = null;
this._aborted = false;
Object.defineProperty(this, "_aborted", {
value: false,
writable: true,
});
}
get aborted() {
return this._aborted;
}
abort() {
this._aborted = true;
if (this.onabort) {
this.onabort(this);
this.onabort = null;
}
}
}

View File

@@ -0,0 +1,2 @@
export * from "./AbortController";
export * from "./AbortSignal";