diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-09 09:21:17 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-09 09:21:17 +0800 |
commit | d703c13f8eca7f7139581468e86cf6d2fa067c1e (patch) | |
tree | 967c7ddd5830f61fe499742bc8f156682dbbd582 /packages/instant | |
parent | 3dacc6157bb7a70db9a281689c1af27ccc7c446f (diff) | |
download | dexon-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')
-rw-r--r-- | packages/instant/src/util/heartbeater.ts | 18 |
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; } } } |