diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-10-27 04:11:47 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-10-27 04:11:47 +0800 |
commit | 6f4dbc71f223f52c16320f3c65be92f99075dfec (patch) | |
tree | 2877617c1d0ccca7bf8ac9687f5108cc830920bc /packages | |
parent | 4bd4ff46cf894a29bc6d4a9b58c4d6a4bd5e2ddd (diff) | |
download | dexon-0x-contracts-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.gz dexon-0x-contracts-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.zst dexon-0x-contracts-6f4dbc71f223f52c16320f3c65be92f99075dfec.zip |
Add back debounce
Diffstat (limited to 'packages')
-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); } }, }); |