mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Updated formatting of cancelable promise
This commit is contained in:
parent
6b7efd1523
commit
1a777738f8
@ -10,10 +10,12 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void) => void,
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void
|
||||
) => void
|
||||
) {
|
||||
this.#isPending = true;
|
||||
this.#isCanceled = false;
|
||||
@ -69,7 +71,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch(error) {
|
||||
this.#reject?.(error);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -68,10 +68,12 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void) => void,
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void
|
||||
) => void
|
||||
) {
|
||||
this.#isPending = true;
|
||||
this.#isCanceled = false;
|
||||
@ -127,7 +129,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch(error) {
|
||||
this.#reject?.(error);
|
||||
return;
|
||||
}
|
||||
@ -2537,10 +2539,12 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void) => void,
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: (cancelHandler: () => void) => void
|
||||
) => void
|
||||
) {
|
||||
this.#isPending = true;
|
||||
this.#isCanceled = false;
|
||||
@ -2596,7 +2600,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch(error) {
|
||||
this.#reject?.(error);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user