Skip to content

Instantly share code, notes, and snippets.

@productioncoder productioncoder/search.js
Last active Nov 19, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.