Skip to content

Instantly share code, notes, and snippets.

@rcdexta
Created February 25, 2021 08:02
Show Gist options
  • Save rcdexta/f8ba7dd0ceb171807e47cc69991b9cdd to your computer and use it in GitHub Desktop.
Save rcdexta/f8ba7dd0ceb171807e47cc69991b9cdd to your computer and use it in GitHub Desktop.
import debounce from "lodash.debounce";
class App extends React.Component {
constructor(props) {
super(props);
this.state = { results: [] };
this.onInput = debounce(this.onInput.bind(this), 500);
}
onInput = (e) => {
// same content...
};
render() {
// same content...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment