Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 17, 2018 10:47
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/e4f6e32ce83ff19cbcd49de4f9cbacbe to your computer and use it in GitHub Desktop.
Save productioncoder/e4f6e32ce83ff19cbcd49de4f9cbacbe to your computer and use it in GitHub Desktop.
Youtube in React: next page token selector
const getComment = (state, location) => {
const videoId = getSearchParam(location, 'v');
return state.comments.byVideo[videoId];
};
export const getCommentNextPageToken = createSelector(
getComment,
(comment) => {
return comment ? comment.nextPageToken : null;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment