Skip to content

Instantly share code, notes, and snippets.

Last active Nov 9, 2018
What would you like to do?
Youtube in React: parse related videos response
function reduceRelatedVideosRequest(responses) {
const relatedVideosResponse = responses.find(r => r.result.kind === SEARCH_LIST_RESPONSE);
const {pageInfo, items, nextPageToken} = relatedVideosResponse.result;
const relatedVideoIds = =>;
return {
totalResults: pageInfo.totalResults,
items: relatedVideoIds
export const SEARCH_LIST_RESPONSE = 'youtube#searchListResponse';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment