import { 
  START_LOADING_ALL_RESULTS,
  LOADED_ALL_RESULTS
} from '../actions/action_types';

export default function(state={}, action) {
  switch (action.type) {

    case START_LOADING_ALL_RESULTS:
      return Object.assign({}, state, { loadingResults: true });

    case LOADED_ALL_RESULTS:
      return Object.assign({}, state, {
        loadingResults: false,
        currentItems: action.payload
      });

    default:
      return state;
  }
};