aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2018-02-05 19:03:36 +0800
committerGitHub <noreply@github.com>2018-02-05 19:03:36 +0800
commitc7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8 (patch)
tree4829624adc8a36ff6d80db185e6021cac846a55a /packages/0x.js
parent44cd185c66b08a5a9b081c972e7cb6764c066506 (diff)
parent85b4a82a4bc1059b3321763e20b8e2c4d8ff0e73 (diff)
downloaddexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar.gz
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar.bz2
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar.lz
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar.xz
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.tar.zst
dexon-sol-tools-c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8.zip
Merge pull request #358 from 0xProject/feature/build_watch
Add build:watch command to all TS packages
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/package.json3
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts8
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> {