Skip to content

Instantly share code, notes, and snippets.

@gyver98
Last active March 17, 2017 12:23
Show Gist options
  • Save gyver98/f1758643b7a9f3a5bcae546abda5861d to your computer and use it in GitHub Desktop.
Save gyver98/f1758643b7a9f3a5bcae546abda5861d to your computer and use it in GitHub Desktop.
import TeslaCounter from '../components/TeslaCounter/TeslaCounter';
import { connect } from 'react-redux';
import { speedUp, speedDown } from '../actions'
import { counterDefaultVal } from '../constants/counterDefaultVal';
const mapStateToProps = (state) => {
return {
currentValue: state.config.speed,
initValues: counterDefaultVal.speed
}
}
const mapDispatchToProps = (dispatch) => {
return {
increment:(value) => {
dispatch(speedUp(value))
},
decrement:(value) => {
dispatch(speedDown(value))
}
}
}
const TeslaSpeedCounterContainer = connect(mapStateToProps, mapDispatchToProps)(TeslaCounter)
export default TeslaSpeedCounterContainer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment