Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 16, 2018 18:43
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/4a4c8f22a2d51135e87b01d0d1f33575 to your computer and use it in GitHub Desktop.
Save productioncoder/4a4c8f22a2d51135e87b01d0d1f33575 to your computer and use it in GitHub Desktop.
Youtube in React: comments reducer for WATCH_DETAILS_SUCCESS
import {COMMENT_THREAD_LIST_RESPONSE} from '../api/youtube-api-response-types';
function reduceWatchDetails(responses, videoId, prevState) {
const commentThreadResponse = responses.find(res => res.result.kind === COMMENT_THREAD_LIST_RESPONSE);
return reduceCommentThread(commentThreadResponse.result, video.id, prevState);
}
/* ... */
export const COMMENT_THREAD_LIST_RESPONSE = 'youtube#commentThreadListResponse';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment