aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_asset_instant_heading.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-16 09:07:19 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-16 09:07:19 +0800
commitf2e5fd88469c9e3396197b42298d0b2de8a4d47c (patch)
tree7f597250870b2157f6e54418fc6c339f63ea8e02 /packages/instant/src/containers/selected_asset_instant_heading.ts
parent18667d739c112955478ab07cb245dc435b31a974 (diff)
downloaddexon-0x-contracts-f2e5fd88469c9e3396197b42298d0b2de8a4d47c.tar.gz
dexon-0x-contracts-f2e5fd88469c9e3396197b42298d0b2de8a4d47c.tar.zst
dexon-0x-contracts-f2e5fd88469c9e3396197b42298d0b2de8a4d47c.zip
Add ts-optchain and use it instead of lodash get
Diffstat (limited to 'packages/instant/src/containers/selected_asset_instant_heading.ts')
-rw-r--r--packages/instant/src/containers/selected_asset_instant_heading.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/instant/src/containers/selected_asset_instant_heading.ts b/packages/instant/src/containers/selected_asset_instant_heading.ts
index a9e853fe1..c97cfe11a 100644
--- a/packages/instant/src/containers/selected_asset_instant_heading.ts
+++ b/packages/instant/src/containers/selected_asset_instant_heading.ts
@@ -2,6 +2,7 @@ import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
+import { oc } from 'ts-optchain';
import { State } from '../redux/reducer';
@@ -17,7 +18,7 @@ interface ConnectedState {
const mapStateToProps = (state: State, _ownProps: InstantHeadingProps): ConnectedState => ({
selectedAssetAmount: state.selectedAssetAmount,
- totalEthBaseAmount: _.get(state, 'latestBuyQuote.worstCaseQuoteInfo.totalEthAmount'),
+ totalEthBaseAmount: oc(state).latestBuyQuote.worstCaseQuoteInfo.totalEthAmount(),
ethUsdPrice: state.ethUsdPrice,
});