aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/utils/PendingTask.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-25 00:14:51 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-25 00:14:51 +0200
commit71491e03468795404751d2edfe58ce78714a5ed1 (patch)
tree14131145cdd704b606f3677e61981be6ab921241 /subprojects/frontend/src/utils/PendingTask.ts
parentfix(frontend): editor font thickness (diff)
downloadrefinery-71491e03468795404751d2edfe58ce78714a5ed1.tar.gz
refinery-71491e03468795404751d2edfe58ce78714a5ed1.tar.zst
refinery-71491e03468795404751d2edfe58ce78714a5ed1.zip
refactor(frontend): xtext update improvements
Diffstat (limited to 'subprojects/frontend/src/utils/PendingTask.ts')
-rw-r--r--subprojects/frontend/src/utils/PendingTask.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts
index 086993d4..3976bdf9 100644
--- a/subprojects/frontend/src/utils/PendingTask.ts
+++ b/subprojects/frontend/src/utils/PendingTask.ts
@@ -9,13 +9,13 @@ export default class PendingTask<T> {
9 9
10 private resolved = false; 10 private resolved = false;
11 11
12 private timeout: number | null; 12 private timeout: number | undefined;
13 13
14 constructor( 14 constructor(
15 resolveCallback: (value: T) => void, 15 resolveCallback: (value: T) => void,
16 rejectCallback: (reason?: unknown) => void, 16 rejectCallback: (reason?: unknown) => void,
17 timeoutMs?: number, 17 timeoutMs?: number | undefined,
18 timeoutCallback?: () => void, 18 timeoutCallback?: () => void | undefined,
19 ) { 19 ) {
20 this.resolveCallback = resolveCallback; 20 this.resolveCallback = resolveCallback;
21 this.rejectCallback = rejectCallback; 21 this.rejectCallback = rejectCallback;
@@ -28,8 +28,6 @@ export default class PendingTask<T> {
28 } 28 }
29 } 29 }
30 }, timeoutMs); 30 }, timeoutMs);
31 } else {
32 this.timeout = null;
33 } 31 }
34 } 32 }
35 33
@@ -53,8 +51,9 @@ export default class PendingTask<T> {
53 51
54 private markResolved() { 52 private markResolved() {
55 this.resolved = true; 53 this.resolved = true;
56 if (this.timeout !== null) { 54 if (this.timeout !== undefined) {
57 clearTimeout(this.timeout); 55 clearTimeout(this.timeout);
56 this.timeout = undefined;
58 } 57 }
59 } 58 }
60} 59}