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 {
1111 Event
1212} from "vscode" ;
1313import { Resource } from "./resource" ;
14- import { throttleAsync } from "./decorators" ;
14+ import { throttleAsync , debounce } from "./decorators" ;
1515import { Repository as BaseRepository } from "./svn" ;
1616import { SvnStatusBar } from "./statusBar" ;
1717import { dispose } from "./util" ;
@@ -80,17 +80,16 @@ export class Repository {
8080 }
8181
8282 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+
8685 this . watcher . onDidChange ( ( ) => {
87- this . update ( ) ;
86+ debounceUpdate ( ) ;
8887 } ) ;
8988 this . watcher . onDidCreate ( ( ) => {
90- this . update ( ) ;
89+ debounceUpdate ( ) ;
9190 } ) ;
9291 this . watcher . onDidDelete ( ( ) => {
93- this . update ( ) ;
92+ debounceUpdate ( ) ;
9493 } ) ;
9594 }
9695
You can’t perform that action at this time.
0 commit comments