From 5d602f8e292e8717dafecfccefc2ea4377f72c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 27 Oct 2021 16:56:26 +0200 Subject: [PATCH] get rid of the ts-ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/backend-tasks/src/tasks/CancelToken.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend-tasks/src/tasks/CancelToken.ts b/packages/backend-tasks/src/tasks/CancelToken.ts index 9ea9802e82..190a5d6562 100644 --- a/packages/backend-tasks/src/tasks/CancelToken.ts +++ b/packages/backend-tasks/src/tasks/CancelToken.ts @@ -15,7 +15,6 @@ */ export class CancelToken { - // @ts-ignore: is actually assigned by the Promise constructor #cancel: () => void; #isCancelled: boolean; #cancelPromise: Promise; @@ -26,6 +25,8 @@ export class CancelToken { private constructor() { this.#isCancelled = false; + + this.#cancel = () => {}; // Avoids a TS warning this.#cancelPromise = new Promise(resolve => { this.#cancel = () => { this.#isCancelled = true;