Resume experience

redux store

by ajinkyax

JavaScript

const actionTypes = {
	GET_EXPERIENCE: 'GET_EXPERIENCE'
};
function expSuccess(payload){
  return {
    type: actionTypes.GET_EXPERIENCE,
    payload
  }
}
function fetchExperience(skill) {
  // --- will do demo fetch here ---
  const axiosGet = axios.get(url);
  return (dispatch) => {
    return axiosGet
      .then(
        success => dispatch(expSuccess(success)),
        error => dispatch(console.error)
      );
  };
}

function reducerExperience(state = {}, action){
	switch(action.type) {
    case actionTypes:
      return Object.assign({}, state, action.payload.data);
    
    default:
      return {javascript: 4, angularjs: 2, angular2: 0.5, react: 0.5, redux: 0.5};
  }
}