Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 17, 2018 10:11
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/78fe23c6325bd92a516afd15d375ecf0 to your computer and use it in GitHub Desktop.
Save productioncoder/78fe23c6325bd92a516afd15d375ecf0 to your computer and use it in GitHub Desktop.
Youtube in React: comment thread action creator
import {createAction, createRequestTypes, FAILURE, REQUEST, SUCCESS} from './index';
export const COMMENT_THREAD = createRequestTypes('COMMENT_THREAD');
export const thread = {
request: (videoId, nextPageToken) => createAction(COMMENT_THREAD[REQUEST], {videoId, nextPageToken}),
success: (response, videoId) => createAction(COMMENT_THREAD[SUCCESS], {response, videoId}),
failure: (response) => createAction(COMMENT_THREAD[FAILURE], {response}),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment