Commit 547e4d20 authored by Alfred Malone's avatar Alfred Malone

removed file and comments

parent 5d5f32ad
......@@ -13,7 +13,6 @@ const initialState = {
export default function incomeReducer(state = initialState, action) {
switch (action.type) {
case ADD_ROW_INCOME:
console.log("hi");
return { ...state, row: [...state.row, 0] };
case REMOVE_ROW_INCOME:
return {
......@@ -25,7 +24,6 @@ export default function incomeReducer(state = initialState, action) {
let rows = [...state.row];
rows[action.idx] = action.e.target.value;
console.log(rows, rows[action.idx]);
//accumulator for total
let total = rows.reduce(
......@@ -33,7 +31,6 @@ export default function incomeReducer(state = initialState, action) {
Number(accumulator) + Number(currentValue)
);
return { ...state, row: rows, total: total, input: rows[action.idx] };
//Object.assign({}, state, { total: action.total.income });
default:
return state;
}
......
import { FETCH_TOTAL } from "../actions/types";
const initialState = {
income: 0,
expense: 0
};
export default function totalReducer(state = initialState, action) {
switch (action.type) {
case FETCH_TOTAL:
return {
...state,
income: action.payload
};
default:
return state;
}
}
......@@ -12,6 +12,4 @@ const Store = createStore(
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);
console.log(Store.getState());
export default Store;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment