Migrate to private class properties/methods

This commit is contained in:
Jamie Kyle 2025-01-14 11:11:52 -08:00 committed by GitHub
commit aa9f53df57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
100 changed files with 3795 additions and 3944 deletions

View file

@ -9,7 +9,7 @@ export interface IController {
}
export class AbortableProcess<Result> implements IController {
private abortReject: (error: Error) => void;
#abortReject: (error: Error) => void;
public readonly resultPromise: Promise<Result>;
@ -21,13 +21,13 @@ export class AbortableProcess<Result> implements IController {
const { promise: abortPromise, reject: abortReject } =
explodePromise<Result>();
this.abortReject = abortReject;
this.#abortReject = abortReject;
this.resultPromise = Promise.race([abortPromise, resultPromise]);
}
public abort(): void {
this.controller.abort();
this.abortReject(new Error(`Process "${this.name}" was aborted`));
this.#abortReject(new Error(`Process "${this.name}" was aborted`));
}
public getResult(): Promise<Result> {