Last active
November 3, 2018 14:32
-
-
Save productioncoder/58766856ce7ed32860f12aeacdbd2297 to your computer and use it in GitHub Desktop.
Youtube: updating videos reducer with WATCH_DETAILS_SUCCESS action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ... */ | |
import {WATCH_DETAILS} from '../actions/watch'; | |
/* ... */ | |
export default function videos(state = initialState, action) { | |
switch (action.type) { | |
case VIDEO_CATEGORIES[SUCCESS]: | |
return reduceFetchVideoCategories(action.response, state); | |
case MOST_POPULAR[SUCCESS]: | |
return reduceFetchMostPopularVideos(action.response, state); | |
case MOST_POPULAR_BY_CATEGORY[SUCCESS]: | |
return reduceFetchMostPopularVideosByCategory(action.response, action.categories, state); | |
case WATCH_DETAILS[SUCCESS]: | |
return reduceWatchDetails(action.response, state); | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment