diff --git a/ts/index.ts b/ts/index.ts index 867223f..de46dfe 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -33,7 +33,7 @@ export let delayForRandom = async ( export class Timeout { promise: Promise; private _deferred: smartpromise.Deferred; - private _timeout: any; + private _timeout; private _cancelled: boolean = false; private timeoutInMillis: number; @@ -63,7 +63,7 @@ export class Timeout { */ public cancel() { this._cancelled = true; - this.makeUnrefed(); + clearTimeout(this._timeout); } public getTimeLeft() {