namirasoft-core
Advanced tools
Comparing version 1.4.29 to 1.4.30
export declare class SetTimeouService { | ||
private callback; | ||
private milliseconds; | ||
private last; | ||
constructor(callback: () => void, milliseconds: number); | ||
setTimeoutIfNotCalledAgain(): void; | ||
setTimeoutIfNotCalledAgain(callback: () => void, milliseconds: number): void; | ||
} |
@@ -6,13 +6,11 @@ "use strict"; | ||
class SetTimeouService { | ||
constructor(callback, milliseconds) { | ||
constructor() { | ||
this.last = new Date(); | ||
this.callback = callback; | ||
this.milliseconds = milliseconds; | ||
} | ||
setTimeoutIfNotCalledAgain() { | ||
setTimeoutIfNotCalledAgain(callback, milliseconds) { | ||
this.last = new Date(); | ||
setTimeout(() => { | ||
if (TimeOperation_1.TimeOperation.millisecondsLater(this.milliseconds, this.last) < new Date()) | ||
this.callback(); | ||
}, this.milliseconds); | ||
if (TimeOperation_1.TimeOperation.millisecondsLater(milliseconds, this.last) < new Date()) | ||
callback(); | ||
}, milliseconds); | ||
} | ||
@@ -19,0 +17,0 @@ } |
@@ -11,3 +11,3 @@ { | ||
"private": false, | ||
"version": "1.4.29", | ||
"version": "1.4.30", | ||
"author": "Amir Abolhasani", | ||
@@ -14,0 +14,0 @@ "license": "MIT", |
@@ -5,19 +5,12 @@ import { TimeOperation } from "./TimeOperation"; | ||
{ | ||
private callback: () => void; | ||
private milliseconds: number; | ||
private last: Date = new Date(); | ||
constructor(callback: () => void, milliseconds: number) | ||
setTimeoutIfNotCalledAgain(callback: () => void, milliseconds: number) | ||
{ | ||
this.callback = callback; | ||
this.milliseconds = milliseconds; | ||
} | ||
setTimeoutIfNotCalledAgain() | ||
{ | ||
this.last = new Date(); | ||
setTimeout(() => | ||
{ | ||
if (TimeOperation.millisecondsLater(this.milliseconds, this.last) < new Date()) | ||
this.callback(); | ||
}, this.milliseconds); | ||
if (TimeOperation.millisecondsLater(milliseconds, this.last) < new Date()) | ||
callback(); | ||
}, milliseconds); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
0
430729
5742