notification.js 790 Bytes
import * as types from '../constants/ActionTypes';

const initialState = {
    notificationList:[],
    notificationListCount:0,
    unreadList:[],
    unreadListCount:0
};

export default function environment(state = initialState, action) {
    switch (action.type) {
      case types.GET_NOTIFICATION_LIST:
          return Object.assign({}, state, {
              notificationList: action.notificationList,
              notificationListCount: action.notificationListCount
          });
          break;
          case types.GET_UNREAD_LIST:
              return Object.assign({}, state, {
                  unreadList: action.unreadList,
                  unreadListCount: action.unreadListCount
              });
              break;
        default:
            return state;
    }
}