aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-17 14:19:15 +0800
committerFabio Berger <me@fabioberger.com>2017-12-17 14:19:15 +0800
commit4a73c05435a653565a92aedfbf56d45997f0673f (patch)
treecb7e848c85de4d5a10e8a30355aa460250d09ef5
parentfe8f2d87c79cb25a7879c2e737dbdd64b7c40f60 (diff)
downloaddexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar.gz
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar.bz2
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar.lz
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar.xz
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.tar.zst
dexon-sol-tools-4a73c05435a653565a92aedfbf56d45997f0673f.zip
Fix documentation issue where `unsubscribeAll` shown as method on every contractWrapper instance even though it's only used by Exchange and Token wrappers.
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts5
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts6
-rw-r--r--packages/0x.js/src/contract_wrappers/token_wrapper.ts6
3 files changed, 13 insertions, 4 deletions
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index a796dc1ec..46916ebf4 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -50,10 +50,7 @@ export class ContractWrapper {
this._onLogAddedSubscriptionToken = undefined;
this._onLogRemovedSubscriptionToken = undefined;
}
- /**
- * Cancels all existing subscriptions
- */
- public unsubscribeAll(): void {
+ protected unsubscribeAll(): void {
const filterTokens = _.keys(this._filterCallbacks);
_.each(filterTokens, filterToken => {
this._unsubscribe(filterToken);
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index 9bed40079..3ca5695c4 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -608,6 +608,12 @@ export class ExchangeWrapper extends ContractWrapper {
this._unsubscribe(subscriptionToken);
}
/**
+ * Cancels all existing subscriptions
+ */
+ public unsubscribeAll(): void {
+ super.unsubscribeAll();
+ }
+ /**
* Gets historical logs without creating a subscription
* @param eventName The exchange contract event you would like to subscribe to.
* @param subscriptionOpts Subscriptions options that let you configure the subscription.
diff --git a/packages/0x.js/src/contract_wrappers/token_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_wrapper.ts
index d1553fa7b..eccb74871 100644
--- a/packages/0x.js/src/contract_wrappers/token_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/token_wrapper.ts
@@ -282,6 +282,12 @@ export class TokenWrapper extends ContractWrapper {
this._unsubscribe(subscriptionToken);
}
/**
+ * Cancels all existing subscriptions
+ */
+ public unsubscribeAll(): void {
+ super.unsubscribeAll();
+ }
+ /**
* Gets historical logs without creating a subscription
* @param tokenAddress An address of the token that emmited the logs.
* @param eventName The token contract event you would like to subscribe to.