From aa60e1dbb2c90b75bb1ef07e0a3d752b9443b89b Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Mon, 19 Mar 2018 19:37:41 +0530 Subject: [PATCH] fix: adds debounce to search api call --- src/webui/src/modules/home/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/webui/src/modules/home/index.js b/src/webui/src/modules/home/index.js index 75f5a4e14..d055cf623 100644 --- a/src/webui/src/modules/home/index.js +++ b/src/webui/src/modules/home/index.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Loading, MessageBox} from 'element-react'; import isEmpty from 'lodash/isEmpty'; +import debounce from 'lodash/debounce'; import API from '../../../utils/api'; @@ -26,6 +27,7 @@ export default class Home extends React.Component { constructor(props) { super(props); this.handleSearchInput = this.handleSearchInput.bind(this); + this.searchPackage = debounce(this.searchPackage, 800); } componentDidMount() {