Fix lint error due to private variable
This commit is contained in:
@@ -24,7 +24,7 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _renderCallback: (start: number, end: number) => void,
|
private _renderCallback: (start: number, end: number) => void,
|
||||||
private readonly debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS
|
private readonly _debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,14 +46,14 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
|
|||||||
// Only refresh if the time since last refresh is above a threshold, otherwise wait for
|
// Only refresh if the time since last refresh is above a threshold, otherwise wait for
|
||||||
// enough time to pass before refreshing again.
|
// enough time to pass before refreshing again.
|
||||||
const refreshRequestTime: number = Date.now();
|
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
|
// Enough time has lapsed since the last refresh; refresh immediately
|
||||||
this._lastRefreshMs = refreshRequestTime;
|
this._lastRefreshMs = refreshRequestTime;
|
||||||
this._innerRefresh();
|
this._innerRefresh();
|
||||||
} else if (!this._additionalRefreshRequested) {
|
} else if (!this._additionalRefreshRequested) {
|
||||||
// This is the first additional request throttled; set up trailing refresh
|
// This is the first additional request throttled; set up trailing refresh
|
||||||
const elapsed = refreshRequestTime - this._lastRefreshMs;
|
const elapsed = refreshRequestTime - this._lastRefreshMs;
|
||||||
const waitPeriodBeforeTrailingRefresh = this.debounceThresholdMS - elapsed;
|
const waitPeriodBeforeTrailingRefresh = this._debounceThresholdMS - elapsed;
|
||||||
this._additionalRefreshRequested = true;
|
this._additionalRefreshRequested = true;
|
||||||
|
|
||||||
this._refreshTimeoutID = window.setTimeout(() => {
|
this._refreshTimeoutID = window.setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user