Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 21, 2018 21:00
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/45bd2e050ff5bf0992c8b9fd2945a9d5 to your computer and use it in GitHub Desktop.
Save productioncoder/45bd2e050ff5bf0992c8b9fd2945a9d5 to your computer and use it in GitHub Desktop.
Youtube in React: search reducer skeleton
import {SEARCH_FOR_VIDEOS} from '../actions/search';
import {SUCCESS} from '../actions';
export default function(state = {}, action) {
switch (action.type) {
case SEARCH_FOR_VIDEOS[SUCCESS]:
return reduceSearchForVideos(action.response, action.searchQuery);
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment