Skip to content

Commit 86141c3

Browse files
committed
Revert "Try to make SimpleDebounce disposable"
This reverts commit 73f3f3c.
1 parent 28f5261 commit 86141c3

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

src/common/utils/debounce.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
import { Disposable } from 'vscode';
2-
3-
export interface SimpleDebounce extends Disposable {
1+
export interface SimpleDebounce {
42
trigger(): void;
53
}
64

7-
class SimpleDebounceImpl extends Disposable {
5+
class SimpleDebounceImpl {
86
private timeout: NodeJS.Timeout | undefined;
97

10-
constructor(private readonly ms: number, private readonly callback: () => void) {
11-
super(() => {
12-
if (this.timeout) {
13-
clearTimeout(this.timeout);
14-
this.timeout = undefined;
15-
}
16-
});
17-
}
8+
constructor(private readonly ms: number, private readonly callback: () => void) {}
189

1910
public trigger() {
2011
if (this.timeout) {
@@ -24,12 +15,6 @@ class SimpleDebounceImpl extends Disposable {
2415
this.callback();
2516
}, this.ms);
2617
}
27-
28-
public dispose() {
29-
if (this.timeout) {
30-
clearTimeout(this.timeout);
31-
}
32-
}
3318
}
3419

3520
export function createSimpleDebounce(ms: number, callback: () => void): SimpleDebounce {

0 commit comments

Comments
 (0)