diff options
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/package.json | 3 | ||||
-rw-r--r-- | packages/0x.js/src/contract_wrappers/contract_wrapper.ts | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index e56c9963e..a967cea16 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -12,6 +12,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { + "build:watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "build": "run-p build:umd:prod build:commonjs; exit 0;", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", @@ -73,7 +74,7 @@ "truffle-hdwallet-provider": "^0.0.3", "tslint": "5.8.0", "typedoc": "~0.8.0", - "typescript": "~2.6.1", + "typescript": "2.7.1", "web3-provider-engine": "^13.0.1", "web3-typescript-typings": "^0.9.8", "webpack": "^3.1.0" diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts index 873489dc9..2d5818618 100644 --- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts @@ -34,8 +34,8 @@ export class ContractWrapper { protected _web3Wrapper: Web3Wrapper; private _networkId: number; private _abiDecoder?: AbiDecoder; - private _blockAndLogStreamerIfExists: BlockAndLogStreamer | undefined; - private _blockAndLogStreamInterval: NodeJS.Timer; + private _blockAndLogStreamerIfExists?: BlockAndLogStreamer; + private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer; private _filters: { [filterToken: string]: Web3.FilterObject }; private _filterCallbacks: { [filterToken: string]: EventCallback<ContractEventArgs>; @@ -162,7 +162,7 @@ export class ContractWrapper { ); const catchAllLogFilter = {}; this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter); - this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval( + this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval( this._reconcileBlockAsync.bind(this), constants.DEFAULT_BLOCK_POLLING_INTERVAL, this._onReconcileBlockError.bind(this), @@ -191,7 +191,7 @@ export class ContractWrapper { } this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string); this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string); - intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamInterval); + intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer); delete this._blockAndLogStreamerIfExists; } private async _reconcileBlockAsync(): Promise<void> { |