aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-10-27 04:11:47 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-10-27 04:11:47 +0800
commit6f4dbc71f223f52c16320f3c65be92f99075dfec (patch)
tree2877617c1d0ccca7bf8ac9687f5108cc830920bc /packages
parent4bd4ff46cf894a29bc6d4a9b58c4d6a4bd5e2ddd (diff)
downloaddexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.gz
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.bz2
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.lz
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.xz
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.tar.zst
dexon-sol-tools-6f4dbc71f223f52c16320f3c65be92f99075dfec.zip
Add back debounce
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts4
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);
}
},
});