aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-09 09:13:22 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-09 09:13:22 +0800
commit297a62fe80142897250f6dd6fddb4cdf1d3fe3ee (patch)
tree92bd8ba2f27d9144bdc1c8fbfda5b50e81015dd5 /packages
parent1e39d56cf751fd922d6fec86ecc8bc70b20bc6bb (diff)
downloaddexon-sol-tools-297a62fe80142897250f6dd6fddb4cdf1d3fe3ee.tar.gz
dexon-sol-tools-297a62fe80142897250f6dd6fddb4cdf1d3fe3ee.tar.zst
dexon-sol-tools-297a62fe80142897250f6dd6fddb4cdf1d3fe3ee.zip
move files around and rename
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx3
-rw-r--r--packages/instant/src/util/heartbeater.ts (renamed from packages/instant/src/util/hearbeats.ts)23
-rw-r--r--packages/instant/src/util/heartbeater_factory.ts18
3 files changed, 20 insertions, 24 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 24ae0c4b6..bbc20dab6 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -15,7 +15,8 @@ import { AffiliateInfo, AssetMetaData, Network, OrderSource } from '../types';
import { assetUtils } from '../util/asset';
import { errorFlasher } from '../util/error_flasher';
import { gasPriceEstimator } from '../util/gas_price_estimator';
-import { generateAccountHeartbeater, Heartbeater, generateBuyQuoteHeartbeater } from '../util/hearbeats';
+import { Heartbeater } from '../util/heartbeater';
+import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
import { providerStateFactory } from '../util/provider_state_factory';
fonts.include();
diff --git a/packages/instant/src/util/hearbeats.ts b/packages/instant/src/util/heartbeater.ts
index ecd7c5068..c5a823953 100644
--- a/packages/instant/src/util/hearbeats.ts
+++ b/packages/instant/src/util/heartbeater.ts
@@ -1,14 +1,4 @@
-// TODO: rename file
-
import * as _ from 'lodash';
-import { Dispatch } from 'redux';
-
-import { Action } from '../redux/actions';
-import { asyncData } from '../redux/async_data';
-import { State } from '../redux/reducer';
-import { Store } from '../redux/store';
-
-import { updateBuyQuoteOrFlashErrorAsyncForState } from './buy_quote_fetcher';
type HeartbeatableFunction = () => Promise<void>;
export class Heartbeater {
@@ -50,16 +40,3 @@ export class Heartbeater {
}
}
}
-
-export const generateAccountHeartbeater = (store: Store): Heartbeater => {
- return new Heartbeater(async () => {
- await asyncData.fetchAccountInfoAndDispatchToStore(store, { setLoading: false });
- });
-};
-
-export const generateBuyQuoteHeartbeater = (store: Store): Heartbeater => {
- return new Heartbeater(async () => {
- await updateBuyQuoteOrFlashErrorAsyncForState(store.getState(), store.dispatch);
- return Promise.resolve();
- });
-};
diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts
new file mode 100644
index 000000000..fc33787ee
--- /dev/null
+++ b/packages/instant/src/util/heartbeater_factory.ts
@@ -0,0 +1,18 @@
+import { asyncData } from '../redux/async_data';
+import { Store } from '../redux/store';
+
+import { updateBuyQuoteOrFlashErrorAsyncForState } from './buy_quote_fetcher';
+import { Heartbeater } from './heartbeater';
+
+export const generateAccountHeartbeater = (store: Store): Heartbeater => {
+ return new Heartbeater(async () => {
+ await asyncData.fetchAccountInfoAndDispatchToStore(store, { setLoading: false });
+ });
+};
+
+export const generateBuyQuoteHeartbeater = (store: Store): Heartbeater => {
+ return new Heartbeater(async () => {
+ await updateBuyQuoteOrFlashErrorAsyncForState(store.getState(), store.dispatch);
+ return Promise.resolve();
+ });
+};