home.js 701 Bytes
import * as types from '../constants/ActionTypes';

const initialState = {
  todoList:[],
  todoListCount:0,
  doneList:[],
  doneListCount:0,
  todayList:[]
};

export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.TO_DO_LIST:
            return Object.assign({}, state, {todoList: action.todoList,todoListCount:action.todoListCount});
        case types.DONE_LIST:
            return Object.assign({}, state, {doneList: action.doneList,doneListCount:action.doneListCount});
        case types.TO_DO_TODAY_LIST:
            return Object.assign({}, state, {todayList: action.todayList}); 
        default:
            return state;
    }
}