Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created October 29, 2018 20:40
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/ee802975a6cf2c0a7399447b203ef919 to your computer and use it in GitHub Desktop.
Save productioncoder/ee802975a6cf2c0a7399447b203ef919 to your computer and use it in GitHub Desktop.
Youtube selectors: video categories loaded and videos by category loaded
export const videoCategoriesLoaded = createSelector(
state => state.videos.categories,
(categories) => {
return Object.keys(categories || {}).length !== 0;
}
);
export const videosByCategoryLoaded = createSelector(
state => state.videos.byCategory,
(videosByCategory) => {
return Object.keys(videosByCategory || {}).length;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment