src/index.js
// below , the function videoSearch only runs every 300 ms
below , the function videoSearch only runs every 300 ms
below the function videoSearch only runs every 300 ms
render() {
    const videoSearch = _.debounce((term) => { this.videoSearch(term) }, 300)
    return (
      <div>
        <SearchBar onSearchTermChange={videoSearch}/>
          <VideoDetail video={this.state.selectedVideo}/>
        <VideoList
          onVideoSelect={selectedVideo => this.setState({selectedVideo}) }
          videos={this.state.videos}
        />
      </div>
    );
  }
render ( ) { const videoSearch = _ . debounce ( ( term ) => { this . videoSearch ( term ) } , 300 ) return ( < div > < SearchBar onSearchTermChange = { videoSearch } / > < VideoDetail video = { this . state . selectedVideo } / > < VideoList onVideoSelect = { selectedVideo => this . setState ( { selectedVideo } ) } videos = { this . state . videos } / > < / div > ) ; }
below , the function videoSearch only runs every 300 ms
below the function videoSearch only runs every 300 ms