diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-10 06:48:05 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-10 06:48:05 +0800 |
commit | b0491b0ee28e6d9fd7e3a5647284c99bd79d4930 (patch) | |
tree | 263a8e5712fea72f78e0a571987c63b431d308b3 /src/order_watcher/event_watcher.ts | |
parent | 0e69356ca9dae26a2940a77d14aca79d0ff36831 (diff) | |
download | dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar.gz dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar.bz2 dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar.lz dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar.xz dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.tar.zst dexon-sol-tools-b0491b0ee28e6d9fd7e3a5647284c99bd79d4930.zip |
Rename _callbackAsync to _callbackIfExistsAsync for clarity
Diffstat (limited to 'src/order_watcher/event_watcher.ts')
-rw-r--r-- | src/order_watcher/event_watcher.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/order_watcher/event_watcher.ts b/src/order_watcher/event_watcher.ts index f1a2b5729..ce471b58d 100644 --- a/src/order_watcher/event_watcher.ts +++ b/src/order_watcher/event_watcher.ts @@ -12,7 +12,7 @@ export class EventWatcher { private _pollingIntervalMs: number; private _intervalId: NodeJS.Timer; private _lastEvents: Web3.LogEntry[] = []; - private _callbackAsync?: EventWatcherCallback; + private _callbackIfExistsAsync?: EventWatcherCallback; constructor(web3Wrapper: Web3Wrapper, pollingIntervalMs: undefined|number) { this._web3Wrapper = web3Wrapper; this._pollingIntervalMs = _.isUndefined(pollingIntervalMs) ? @@ -20,13 +20,13 @@ export class EventWatcher { pollingIntervalMs; } public subscribe(callback: EventWatcherCallback, numConfirmations: number): void { - this._callbackAsync = callback; + this._callbackIfExistsAsync = callback; this._intervalId = intervalUtils.setAsyncExcludingInterval( this._pollForMempoolEventsAsync.bind(this, numConfirmations), this._pollingIntervalMs, ); } public unsubscribe(): void { - delete this._callbackAsync; + delete this._callbackIfExistsAsync; this._lastEvents = []; intervalUtils.clearAsyncExcludingInterval(this._intervalId); } @@ -70,8 +70,8 @@ export class EventWatcher { removed: isRemoved, ...log, }; - if (!_.isUndefined(this._callbackAsync)) { - await this._callbackAsync(logEvent); + if (!_.isUndefined(this._callbackIfExistsAsync)) { + await this._callbackIfExistsAsync(logEvent); } } } |