Skip to content

Commit

Permalink
StephenGrider#45 Lecture code.
Browse files Browse the repository at this point in the history
  • Loading branch information
USER authored and USER committed Jul 7, 2019
1 parent 69ae34f commit 3dab86f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


export function selectBook(selectBook) {
console.log('A book has been selected:', book.title);
}
8 changes: 8 additions & 0 deletions src/containers/book-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ function mapStateToProps(state) {

}


//Anything returned from this function will end up as props
//on the BookList container
function mapDispatchToProps(dispatch){
//Whenever selectBook is called, the result should be passed
//to all of our reducers
return bindActionCreators({selectBook: selectBook}, dispatch);
}

// Promote BookList from a component to a container - it needs to know
// about this new dispatch method, selectBook.
// Make it available as a prop.
export default connect(mapStateToProps, mapDispatchToProps)(BookList);

0 comments on commit 3dab86f

Please sign in to comment.