0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-17 23:45:29 -05:00

Merge pull request #632 from ayusharma/issue-385

fix: adds debounce to search api call
This commit is contained in:
Juan Picado @jotadeveloper 2018-03-20 07:38:42 +01:00 committed by GitHub
commit be293a7641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {