1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-11-14 10:50:04 -05:00
moneygo/js/reducers/SelectedReportReducer.js

24 lines
532 B
JavaScript
Raw Normal View History

2017-02-17 10:01:31 -05:00
var assign = require('object-assign');
var ReportConstants = require('../constants/ReportConstants');
var UserConstants = require('../constants/UserConstants');
const initialState = {
report: null,
seriesTraversal: []
};
module.exports = function(state = initialState, action) {
switch (action.type) {
case ReportConstants.REPORT_SELECTED:
return {
report: action.report,
seriesTraversal: action.seriesTraversal
};
case UserConstants.USER_LOGGEDOUT:
return initialState;
default:
return state;
}
};