mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-13 23:44:09 +01:00
RunOnceScheduler.isScheduled()
This commit is contained in:
@@ -529,7 +529,7 @@ export class RunOnceScheduler {
|
||||
* Cancel current scheduled runner (if any).
|
||||
*/
|
||||
public cancel(): void {
|
||||
if (this.timeoutToken !== -1) {
|
||||
if (this.isScheduled()) {
|
||||
platform.clearTimeout(this.timeoutToken);
|
||||
this.timeoutToken = -1;
|
||||
}
|
||||
@@ -557,6 +557,13 @@ export class RunOnceScheduler {
|
||||
this.timeoutToken = platform.setTimeout(this.timeoutHandler, this.timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if scheduled.
|
||||
*/
|
||||
public isScheduled(): boolean {
|
||||
return this.timeoutToken !== -1;
|
||||
}
|
||||
|
||||
private onTimeout() {
|
||||
this.timeoutToken = -1;
|
||||
if (this.runner) {
|
||||
|
||||
Reference in New Issue
Block a user