title: How can I update the state of reducer?
body: <p>I want to update the state of activitiesData when ACTIVITIES_SEND_SUCCESS is executed by appending the new data to the end of the object activitiesData.</p>
  
  <blockquote>
    <p>ActivitiesReducer.js</p>
  </blockquote>
  
  <pre><code>import {
    ACTIVITIES_FETCH_SUCCESS,
    ACTIVITIES_SEND_SUCCESS,
    SUBACTIVITY_SEND_SUCCESS
  } from '../actions/types';
  
  const INITIAL_STATE = { activitiesData: {}, activityCreated: {}, listActivity: {} };
  
  export default (state = INITIAL_STATE, action) =&gt; {
    switch (action.type) {
      case ACTIVITIES_FETCH_SUCCESS:
        return { ...state, activitiesData: action.payload };
      case ACTIVITIES_SEND_SUCCESS:
        return { ...state, activityCreated: action.payload };
        case SUBACTIVITY_SEND_SUCCESS:
        return { ...state, listActivity: action.payload };
      default:
        return state;
    }
  };
  </code></pre>