Skip to content

Commit

Permalink
get rid of the ts-ignore
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
  • Loading branch information
freben committed Nov 11, 2021
1 parent 3f12371 commit 5d602f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/backend-tasks/src/tasks/CancelToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

export class CancelToken {
// @ts-ignore: is actually assigned by the Promise constructor
#cancel: () => void;
#isCancelled: boolean;
#cancelPromise: Promise<void>;
Expand All @@ -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;
Expand Down

0 comments on commit 5d602f8

Please sign in to comment.