Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.