From 36b8c9c5dd6cc650eaed8a2a6abd8f596c189fed Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Fri, 9 Nov 2018 11:28:08 -0800 Subject: Use interface like named parameters here --- packages/instant/src/redux/async_data.ts | 5 +++-- packages/instant/src/util/heartbeater_factory.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts index 61de54d82..1f1cafdf3 100644 --- a/packages/instant/src/redux/async_data.ts +++ b/packages/instant/src/redux/async_data.ts @@ -36,10 +36,11 @@ export const asyncData = { store.dispatch(actions.setAvailableAssets([])); } }, - fetchAccountInfoAndDispatchToStore: async (store: Store, options = { setLoading: true }) => { + fetchAccountInfoAndDispatchToStore: async (options: { store: Store; setLoading: boolean }) => { + const { store, setLoading } = options; const { providerState } = store.getState(); const web3Wrapper = providerState.web3Wrapper; - if (options.setLoading && providerState.account.state !== AccountState.Loading) { + if (setLoading && providerState.account.state !== AccountState.Loading) { store.dispatch(actions.setAccountStateLoading()); } let availableAddresses: string[]; diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts index 0feb05422..805483b71 100644 --- a/packages/instant/src/util/heartbeater_factory.ts +++ b/packages/instant/src/util/heartbeater_factory.ts @@ -10,7 +10,7 @@ export interface HeartbeatFactoryOptions { export const generateAccountHeartbeater = (options: HeartbeatFactoryOptions): Heartbeater => { const { store, performImmediatelyOnStart } = options; return new Heartbeater(async () => { - await asyncData.fetchAccountInfoAndDispatchToStore(store, { setLoading: false }); + await asyncData.fetchAccountInfoAndDispatchToStore({ store, setLoading: false }); }, performImmediatelyOnStart); }; -- cgit v1.2.3