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;
    }
}

@@ -23,16 +23,54 @@
 TIMELINE
+, CREATED_FAVORITE, DESTROYED_FAVORITE
 %7D from '
@@ -356,16 +356,510 @@
      %7D;%0A
+%0A        case CREATED_FAVORITE:%0A        case DESTROYED_FAVORITE:%0A            const currentTweets = state.tweets;%0A            const updatedTweet = action.tweet;%0A            const replacedTweets = currentTweets.map(tweet =%3E %7B%0A                if (tweet.id_str == updatedTweet.id_str) %7B%0A                    return updatedTweet;%0A                %7D else %7B%0A                    return tweet;%0A                %7D%0A            %7D);%0A%0A            return %7B%0A                tweets: replacedTweets%0A            %7D;%0A%0A
         

Update favorited tweet state