1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-11-01 00:10:06 -04:00
moneygo/js/containers/MoneyGoAppContainer.js

34 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-10-05 13:36:47 -04:00
var connect = require('react-redux').connect;
var UserActions = require('../actions/UserActions');
var AccountActions = require('../actions/AccountActions');
var TransactionActions = require('../actions/TransactionActions');
2017-06-21 21:25:38 -04:00
var SecurityTemplateActions = require('../actions/SecurityTemplateActions');
2016-10-05 13:36:47 -04:00
var MoneyGoApp = require('../components/MoneyGoApp');
2016-10-05 13:36:47 -04:00
function mapStateToProps(state) {
return {
user: state.user,
accounts: state.accounts.map,
accountChildren: state.accounts.children,
selectedAccount: state.selectedAccount,
security_list: state.securities.list,
2016-10-05 13:36:47 -04:00
}
}
function mapDispatchToProps(dispatch) {
return {
tryResumingSession: function() {dispatch(UserActions.tryResumingSession())},
2017-06-21 21:25:38 -04:00
fetchCurrencies: function() {dispatch(SecurityTemplateActions.fetchCurrencies())},
onCreateAccount: function(account) {dispatch(AccountActions.create(account))},
onSelectAccount: function(accountId) {dispatch(AccountActions.select(accountId))},
onFetchTransactionPage: function(account, pageSize, page) {dispatch(TransactionActions.fetchPage(account, pageSize, page))},
2016-10-05 13:36:47 -04:00
}
}
module.exports = connect(
mapStateToProps,
mapDispatchToProps
)(MoneyGoApp)