Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 17, 2018 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/6472a4ae410119e83bc0b252d59e6a86 to your computer and use it in GitHub Desktop.
Save productioncoder/6472a4ae410119e83bc0b252d59e6a86 to your computer and use it in GitHub Desktop.
Youtube in React: handling COMMENT_THREAD_SUCCESS action
/* ... */
import {COMMENT_THREAD} from '../actions/comment';
/* ... */
export default function (state = initialState, action) {
switch (action.type) {
case COMMENT_THREAD[SUCCESS]:
return reduceCommentThread(action.response, action.videoId, state);
case WATCH_DETAILS[SUCCESS]:
return reduceWatchDetails(action.response, action.videoId, state);
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment