Last active
December 16, 2017 18:50
-
-
Save olegkalyta/9da36a6cda96e771683c013b3e6e2a2f to your computer and use it in GitHub Desktop.
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
// reducer | |
initialState = { | |
isFetching: false, | |
error, | |
programs | |
} | |
// ProgramsController | |
import Loadable from './Loadable' | |
import ProgramsView from './ProgramsView' | |
import { fetchPrograms } from './programsReducer' | |
const mapStateToProps = state => { | |
const { programs: { isFetching, error, programs } } = state | |
return { isFetching, error, programs } | |
} | |
const mapDispatchToProps = ({ fetchData: fetchPrograms }) | |
const ProgramsContainer = connect(mapStateToProps, mapDispatchToProps)(Loadable) | |
// using | |
const Programs = () => ( | |
<ProgramsContainer> | |
<ProgramsView /> | |
<ProgramsContainer /> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment