diff --git a/src/templates/core/CancelablePromise.hbs b/src/templates/core/CancelablePromise.hbs index ff02b01c..2d65e219 100644 --- a/src/templates/core/CancelablePromise.hbs +++ b/src/templates/core/CancelablePromise.hbs @@ -10,10 +10,12 @@ export class CancelablePromise implements Promise { #resolve?: (value: T | PromiseLike) => void; #reject?: (reason?: any) => void; - constructor(executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: (cancelHandler: () => void) => void) => void, + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: any) => void, + onCancel: (cancelHandler: () => void) => void + ) => void ) { this.#isPending = true; this.#isCanceled = false; @@ -69,7 +71,7 @@ export class CancelablePromise implements Promise { for (const cancelHandler of this.#cancelHandlers) { cancelHandler(); } - } catch (error) { + } catch(error) { this.#reject?.(error); return; } diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index a2674163..34795e5e 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -68,10 +68,12 @@ export class CancelablePromise implements Promise { #resolve?: (value: T | PromiseLike) => void; #reject?: (reason?: any) => void; - constructor(executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: (cancelHandler: () => void) => void) => void, + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: any) => void, + onCancel: (cancelHandler: () => void) => void + ) => void ) { this.#isPending = true; this.#isCanceled = false; @@ -127,7 +129,7 @@ export class CancelablePromise implements Promise { for (const cancelHandler of this.#cancelHandlers) { cancelHandler(); } - } catch (error) { + } catch(error) { this.#reject?.(error); return; } @@ -2537,10 +2539,12 @@ export class CancelablePromise implements Promise { #resolve?: (value: T | PromiseLike) => void; #reject?: (reason?: any) => void; - constructor(executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: (cancelHandler: () => void) => void) => void, + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: any) => void, + onCancel: (cancelHandler: () => void) => void + ) => void ) { this.#isPending = true; this.#isCanceled = false; @@ -2596,7 +2600,7 @@ export class CancelablePromise implements Promise { for (const cancelHandler of this.#cancelHandlers) { cancelHandler(); } - } catch (error) { + } catch(error) { this.#reject?.(error); return; }