Skip to content

Instantly share code, notes, and snippets.

@kvendrik
Created April 9, 2019 13:47
Show Gist options
  • Save kvendrik/5842ae66080929700866350ab4463afd to your computer and use it in GitHub Desktop.
Save kvendrik/5842ae66080929700866350ab4463afd to your computer and use it in GitHub Desktop.
Medium Article <Search />
class Search extends React.Component {
render() {
  return <input onChange={this.handleChange} />;
  }
 
  handleChange({target: {value}}) {
  this.doSearch(value);
  }
 
  @debounce(200)
  @bind
  doSearch(query) {
  // search for the given query
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment