import { TEST_ACTION, START_LOADING_VIDEOS, RECEIVE_VIDEOS } from '../actions/action_types';

export default function (state = {}, action) {

  switch (action.type) {
    case TEST_ACTION:
      return Object.assign({}, state, { test: action.payload });

    case START_LOADING_VIDEOS:
      return Object.assign({}, state, { loading: true });

    case RECEIVE_VIDEOS:
      return Object.assign({}, state, { loading: false, videos: action.payload })
  }

  return state;
}