File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
11
11
Event
12
12
} from "vscode" ;
13
13
import { Resource } from "./resource" ;
14
- import { throttleAsync } from "./decorators" ;
14
+ import { throttleAsync , debounce } from "./decorators" ;
15
15
import { Repository as BaseRepository } from "./svn" ;
16
16
import { SvnStatusBar } from "./statusBar" ;
17
17
import { dispose } from "./util" ;
@@ -80,17 +80,16 @@ export class Repository {
80
80
}
81
81
82
82
private addEventListeners ( ) {
83
- // this.watcher.onDidChange(throttleAsync(this.update, "update", this));
84
- // this.watcher.onDidCreate(throttleAsync(this.update, "update", this));
85
- // this.watcher.onDidDelete(throttleAsync(this.update, "update", this));
83
+ const debounceUpdate = debounce ( this . update , 1000 , this ) ;
84
+
86
85
this . watcher . onDidChange ( ( ) => {
87
- this . update ( ) ;
86
+ debounceUpdate ( ) ;
88
87
} ) ;
89
88
this . watcher . onDidCreate ( ( ) => {
90
- this . update ( ) ;
89
+ debounceUpdate ( ) ;
91
90
} ) ;
92
91
this . watcher . onDidDelete ( ( ) => {
93
- this . update ( ) ;
92
+ debounceUpdate ( ) ;
94
93
} ) ;
95
94
}
96
95
You can’t perform that action at this time.
0 commit comments