Skip to content

Commit

Permalink
added lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Dec 21, 2015
1 parent a67f76e commit faa2405
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"babel-preset-stage-1": "^6.1.18",
"lodash": "^3.10.1",
"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "^4.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search';
Expand Down Expand Up @@ -28,9 +29,11 @@ class App extends Component {
}

render() {
const videoSearch = _.debounce((term) => { this.videoSearch(term) }, 300);

return (
<div>
<SearchBar onSearchTermChange={term => this.videoSearch(term)} />
<SearchBar onSearchTermChange={videoSearch} />
<VideoDetail video={this.state.selectedVideo} />
<VideoList
onVideoSelect={selectedVideo => this.setState({selectedVideo}) }
Expand Down

0 comments on commit faa2405

Please sign in to comment.