mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-24 23:55:46 -05:00
Merge pull request #632 from ayusharma/issue-385
fix: adds debounce to search api call
This commit is contained in:
commit
be293a7641
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {Loading, MessageBox} from 'element-react';
|
import {Loading, MessageBox} from 'element-react';
|
||||||
import isEmpty from 'lodash/isEmpty';
|
import isEmpty from 'lodash/isEmpty';
|
||||||
|
import debounce from 'lodash/debounce';
|
||||||
|
|
||||||
import API from '../../../utils/api';
|
import API from '../../../utils/api';
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ export default class Home extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.handleSearchInput = this.handleSearchInput.bind(this);
|
this.handleSearchInput = this.handleSearchInput.bind(this);
|
||||||
|
this.searchPackage = debounce(this.searchPackage, 800);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue