Skip to content

Commit

Permalink
Fix lint error due to private variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pattch committed Aug 17, 2021
1 parent e778df6 commit 42e0fcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/browser/TimeBasedDebouncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class TimeBasedDebouncer implements IRenderDebouncer {

constructor(
private _renderCallback: (start: number, end: number) => void,
private readonly debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS
private readonly _debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS
) {
}

Expand All @@ -46,14 +46,14 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
// Only refresh if the time since last refresh is above a threshold, otherwise wait for
// enough time to pass before refreshing again.
const refreshRequestTime: number = Date.now();
if (refreshRequestTime - this._lastRefreshMs >= this.debounceThresholdMS) {
if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {
// Enough time has lapsed since the last refresh; refresh immediately
this._lastRefreshMs = refreshRequestTime;
this._innerRefresh();
} else if (!this._additionalRefreshRequested) {
// This is the first additional request throttled; set up trailing refresh
const elapsed = refreshRequestTime - this._lastRefreshMs;
const waitPeriodBeforeTrailingRefresh = this.debounceThresholdMS - elapsed;
const waitPeriodBeforeTrailingRefresh = this._debounceThresholdMS - elapsed;
this._additionalRefreshRequested = true;

this._refreshTimeoutID = window.setTimeout(() => {
Expand Down

0 comments on commit 42e0fcd

Please sign in to comment.