diff options
Diffstat (limited to 'packages/instant/src')
-rw-r--r-- | packages/instant/src/containers/selected_erc20_asset_amount_input.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts index 828c4fcb5..ee76e9d66 100644 --- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts +++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts @@ -79,6 +79,8 @@ const updateBuyQuoteAsync = async ( dispatch(actions.updateLatestBuyQuote(newBuyQuote)); }; +const debouncedUpdateBuyQuoteAsync = _.debounce(updateBuyQuoteAsync, 200, { trailing: true }); + const mapDispatchToProps = ( dispatch: Dispatch<Action>, _ownProps: SelectedERC20AssetAmountInputProps, @@ -95,7 +97,7 @@ const mapDispatchToProps = ( // even if it's debounced, give them the illusion it's loading dispatch(actions.setQuoteRequestStatePending()); // tslint:disable-next-line:no-floating-promises - updateBuyQuoteAsync(assetBuyer, dispatch, asset, value); + debouncedUpdateBuyQuoteAsync(assetBuyer, dispatch, asset, value); } }, }); |