Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 18, 2018 13:58
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/d687c935567901cd0219f6600d0dbf61 to your computer and use it in GitHub Desktop.
Save productioncoder/d687c935567901cd0219f6600d0dbf61 to your computer and use it in GitHub Desktop.
Youtube in React: selector that checks if more trending videos are available
export const allMostPopularVideosLoaded = createSelector(
[getMostPopular],
(mostPopular) => {
const amountFetchedItems = mostPopular.items ? mostPopular.items.length : 0;
return amountFetchedItems === mostPopular.totalResults;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment