Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 16, 2018 19:18
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/fdb8b2b81690b34f9082a19dc873e3eb to your computer and use it in GitHub Desktop.
Save productioncoder/fdb8b2b81690b34f9082a19dc873e3eb to your computer and use it in GitHub Desktop.
Youtube in React: total amount of comments selector
export const getAmountComments = createSelector(
getVideoById,
(video) => {
if (video) {
return video.statistics.commentCount;
}
return 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment