Last active
January 22, 2017 21:10
-
-
Save ryanjyost/e69e0544caa16b03a36aa9451c2406e8 to your computer and use it in GitHub Desktop.
rainy-day-fund/src/components/AssumptionsContainer.js
This file contains hidden or 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
| //src/components/AssumptionsContainer | |
| import { connect } from 'react-redux'; | |
| import { updateIncomeSources, updateIncome, updateSavings } from '../actions' | |
| import Assumptions from './Assumptions' | |
| const mapStateToProps = (state) => { | |
| return { | |
| assumptions: state.assumptions, | |
| } | |
| } | |
| const mapDispatchToProps = (dispatch) => { | |
| return { | |
| handleUpdateIncomeSources: (sources) => { | |
| dispatch(updateIncomeSources(Number(sources))) | |
| }, | |
| handleUpdateIncome: (income) => { | |
| dispatch(updateIncome( | |
| Number((income).replace(",","")) | |
| )) | |
| }, | |
| handleUpdateSavings: (savings) => { | |
| dispatch(updateSavings( | |
| Number((savings).replace(",", "")) | |
| )) | |
| } | |
| } | |
| } | |
| const AssumptionsContainer = connect( | |
| mapStateToProps, | |
| mapDispatchToProps | |
| )(Assumptions) | |
| export default AssumptionsContainer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment