From d703c13f8eca7f7139581468e86cf6d2fa067c1e Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Thu, 8 Nov 2018 17:21:17 -0800 Subject: Variable name cleanup --- packages/instant/src/util/heartbeater.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/util/heartbeater.ts b/packages/instant/src/util/heartbeater.ts index c5a823953..bb4e99383 100644 --- a/packages/instant/src/util/heartbeater.ts +++ b/packages/instant/src/util/heartbeater.ts @@ -3,12 +3,12 @@ import * as _ from 'lodash'; type HeartbeatableFunction = () => Promise; export class Heartbeater { private _intervalId?: number; - private _pendingRequest: boolean; - private _performingFunctionAsync: HeartbeatableFunction; + private _hasPendingRequest: boolean; + private _performFunction: HeartbeatableFunction; public constructor(_performingFunctionAsync: HeartbeatableFunction) { - this._performingFunctionAsync = _performingFunctionAsync; - this._pendingRequest = false; + this._performFunction = _performingFunctionAsync; + this._hasPendingRequest = false; } public start(intervalTimeMs: number): void { @@ -24,19 +24,19 @@ export class Heartbeater { window.clearInterval(this._intervalId); } this._intervalId = undefined; - this._pendingRequest = false; + this._hasPendingRequest = false; } private async _trackAndPerformAsync(): Promise { - if (this._pendingRequest) { + if (this._hasPendingRequest) { return; } - this._pendingRequest = true; + this._hasPendingRequest = true; try { - await this._performingFunctionAsync(); + await this._performFunction(); } finally { - this._pendingRequest = false; + this._hasPendingRequest = false; } } } -- cgit