1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-12-26 23:42:29 -05:00
moneygo/js/containers/ReportsTabContainer.js
Aaron Lindsay 25b04a4f0f Stop creating lists in containers
Create them only when needed in reducers instead
2017-06-21 21:27:41 -04:00

28 lines
927 B
JavaScript

var connect = require('react-redux').connect;
var ReportActions = require('../actions/ReportActions');
var ReportsTab = require('../components/ReportsTab');
function mapStateToProps(state) {
return {
reports: state.reports
}
}
function mapDispatchToProps(dispatch) {
return {
onFetchAllReports: function() {dispatch(ReportActions.fetchAll())},
onCreateReport: function(report) {dispatch(ReportActions.create(report))},
onUpdateReport: function(report) {dispatch(ReportActions.update(report))},
onDeleteReport: function(report) {dispatch(ReportActions.remove(report))},
onSelectReport: function(report) {dispatch(ReportActions.select(report))},
onTabulateReport: function(report) {dispatch(ReportActions.tabulate(report))},
onSelectSeries: function(seriesTraversal) {dispatch(ReportActions.selectSeries(seriesTraversal))}
}
}
module.exports = connect(
mapStateToProps,
mapDispatchToProps
)(ReportsTab)