Last active
March 17, 2017 12:24
-
-
Save gyver98/0986225c521d3213875a9849bf1e9d80 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 TeslaCounter from '../components/TeslaCounter/TeslaCounter'; | |
import { connect } from 'react-redux'; | |
import { temperatureUp, temperatureDown } from '../actions' | |
import { counterDefaultVal } from '../constants/counterDefaultVal'; | |
const mapStateToProps = (state) => { | |
return { | |
currentValue: state.config.temperature, | |
initValues: counterDefaultVal.temperature | |
} | |
} | |
const mapDispatchToProps = (dispatch) => { | |
return { | |
increment:(value) => { | |
dispatch(temperatureUp(value)) | |
}, | |
decrement:(value) => { | |
dispatch(temperatureDown(value)) | |
} | |
} | |
} | |
const TeslaTempCounterContainer = connect(mapStateToProps, mapDispatchToProps)(TeslaCounter) | |
export default TeslaTempCounterContainer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment