aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-09 09:21:17 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-09 09:21:17 +0800
commitd703c13f8eca7f7139581468e86cf6d2fa067c1e (patch)
tree967c7ddd5830f61fe499742bc8f156682dbbd582 /packages/instant/src
parent3dacc6157bb7a70db9a281689c1af27ccc7c446f (diff)
downloaddexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar.gz
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar.bz2
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar.lz
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar.xz
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.tar.zst
dexon-sol-tools-d703c13f8eca7f7139581468e86cf6d2fa067c1e.zip
Variable name cleanup
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/util/heartbeater.ts18
1 files changed, 9 insertions, 9 deletions
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<void>;
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<void> {
- 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;
}
}
}