File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
3520export function createSimpleDebounce ( ms : number , callback : ( ) => void ) : SimpleDebounce {
You can’t perform that action at this time.
0 commit comments