old_contents: import {RECEIVED_HOME_TIMELINE} from '../constants/ActionTypes'
  
  const initialState = {tweets: []};
  
  export default function timeline(state = initialState, action) {
      switch (action.type) {
          case RECEIVED_HOME_TIMELINE:
              return {
                  tweets: action.tweets.concat(state.tweets)
              };
          default:
              return state;
      }
  }
  
new_contents: import {RECEIVED_HOME_TIMELINE, CREATED_FAVORITE, DESTROYED_FAVORITE} from '../constants/ActionTypes'
  
  const initialState = {tweets: []};
  
  export default function timeline(state = initialState, action) {
      switch (action.type) {
          case RECEIVED_HOME_TIMELINE:
              return {
                  tweets: action.tweets.concat(state.tweets)
              };
  
          case CREATED_FAVORITE:
          case DESTROYED_FAVORITE:
              const currentTweets = state.tweets;
              const updatedTweet = action.tweet;
              const replacedTweets = currentTweets.map(tweet => {
                  if (tweet.id_str == updatedTweet.id_str) {
                      return updatedTweet;
                  } else {
                      return tweet;
                  }
              });
  
              return {
                  tweets: replacedTweets
              };
  
          default:
              return state;
      }
  }
  
subject: Update favorited tweet state