Last active
March 20, 2016 23:05
-
-
Save chuck0523/040c974d245d264068a5 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
import { connect } from 'react-redux' | |
import { prevPage, nextPage } from '../actions' | |
import Slide from '../components/Slide' | |
const getCurrentPage = (currentPage = 0) => { | |
return currentPage | |
} | |
const mapStateToProps = (state) => { | |
return { | |
currentPage: getCurrentPage(state.slide) | |
} | |
} | |
const mapDispatchToProps = (dispatch) => { | |
return { | |
onPrevClick: (currentPage) => { | |
// console.log(currentPage) | |
dispatch(prevPage(currentPage)) | |
}, | |
onNextClick: (currentPage)=> { | |
dispatch(nextPage(currentPage)) | |
} | |
} | |
} | |
const SwipePage = connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(Slide) | |
export default SwipePage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment