Last active
October 13, 2017 14:55
-
-
Save davelosert/cd54ea3c953546904b2f0595f290e503 to your computer and use it in GitHub Desktop.
Code Examples for a Blogpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {connect} from 'react-redux'; | |
import {TodoList} from '../components/TodoList'; | |
import {fetchAllTodos} from '../todo-repository/fetch-todos-thunk'; | |
const mapStateToProps = ({loading, todos}) => { | |
return { | |
loading, | |
todos | |
}; | |
}; | |
const mapDispatchToProps = (dispatch) => { | |
return { | |
initTodos: () => dispatch(fetchAllTodos()) | |
}; | |
}; | |
export default connect(mapStateToProps, mapDispatchToProps)(TodoList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment