text: import ActionTypes from '../actions/action-types';
  
  /**
   * viewersReducer
   */
  export const viewersReducer = (state = {}, action) => {
    switch (action.type) {
      case ActionTypes.UPDATE_VIEWPORT:
        return {
          ...state,
          [action.windowId]: {
            ...action.payload,
          },
        };
      case ActionTypes.REMOVE_WINDOW:
        return Object.keys(state).reduce((object, key) => {
          if (key !== action.windowId) {
            object[key] = state[key]; // eslint-disable-line no-param-reassign
          }
          return object;
        }, {});
      default:
        return state;
    }
  };
  