Reactjs and redux - How to prevent excessive api calls from a live-search component?
问题 I have created this live-search component: class SearchEngine extends Component { constructor (props) { super(props); this.handleChange = this.handleChange.bind(this); this.handleSearch = this.handleSearch.bind(this); } handleChange (e) { this.props.handleInput(e.target.value); //Redux } handleSearch (input, token) { this.props.handleSearch(input, token) //Redux }; componentWillUpdate(nextProps) { if(this.props.input !== nextProps.input){ this.handleSearch(nextProps.input, this.props