diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-10 02:40:47 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-10 02:40:47 +0800 |
commit | 2e8f74abce7be3a5799bb93a0360d299de55b621 (patch) | |
tree | e052e2d4aeaf85546cde770748ebc5d2058ea109 /packages/instant/src/util/heartbeater_factory.ts | |
parent | df91d343154bced69be86f7af4c4c702286cfd16 (diff) | |
download | dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar.gz dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar.bz2 dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar.lz dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar.xz dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.tar.zst dexon-0x-contracts-2e8f74abce7be3a5799bb93a0360d299de55b621.zip |
Use existing functions instead of writing our own
Diffstat (limited to 'packages/instant/src/util/heartbeater_factory.ts')
-rw-r--r-- | packages/instant/src/util/heartbeater_factory.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts index 9fac9cf4c..beedb66c8 100644 --- a/packages/instant/src/util/heartbeater_factory.ts +++ b/packages/instant/src/util/heartbeater_factory.ts @@ -1,17 +1,16 @@ 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 => { +export const generateAccountHeartbeater = (store: Store, performImmediatelyOnStart: boolean): Heartbeater => { return new Heartbeater(async () => { await asyncData.fetchAccountInfoAndDispatchToStore(store, { setLoading: false }); - }); + }, performImmediatelyOnStart); }; -export const generateBuyQuoteHeartbeater = (store: Store): Heartbeater => { +export const generateBuyQuoteHeartbeater = (store: Store, performImmediatelyOnStart: boolean): Heartbeater => { return new Heartbeater(async () => { - await updateBuyQuoteOrFlashErrorAsyncForState(store.getState(), store.dispatch); - }); + await asyncData.fetchCurrentBuyQuoteAndDispatchToStore(store, false); + }, performImmediatelyOnStart); }; |