Last active
November 16, 2018 18:43
-
-
Save productioncoder/4a4c8f22a2d51135e87b01d0d1f33575 to your computer and use it in GitHub Desktop.
Youtube in React: comments reducer for WATCH_DETAILS_SUCCESS
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 {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); | |
} |
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
/* ... */ | |
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