Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 19, 2018 19:44
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/bff00bc91df6edb092d2c0f78ae39d76 to your computer and use it in GitHub Desktop.
Save productioncoder/bff00bc91df6edb092d2c0f78ae39d76 to your computer and use it in GitHub Desktop.
Youtube in React: search action creator
export const SEARCH_FOR_VIDEOS = createRequestTypes('SEARCH_FOR_VIDEOS');
export const forVideos = {
request: (searchQuery, nextPageToken, amount) => createAction(SEARCH_FOR_VIDEOS[REQUEST], {searchQuery, nextPageToken, amount}),
success: (response, searchQuery) => createAction(SEARCH_FOR_VIDEOS[SUCCESS], {response, searchQuery}),
failure: (response, searchQuery) => createAction(SEARCH_FOR_VIDEOS[FAILURE], {response, searchQuery}),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment