Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 11, 2018 13:56
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/5442937c3df6bcde2765604118b7de51 to your computer and use it in GitHub Desktop.
Save productioncoder/5442937c3df6bcde2765604118b7de51 to your computer and use it in GitHub Desktop.
Youtube in React: channels reducer skeleton
import {VIDEO_DETAILS, WATCH_DETAILS} from '../actions/watch';
import {SUCCESS} from '../actions';
import {CHANNEL_LIST_RESPONSE} from '../api/youtube-api-response-types';
const initialState = {
byId: {}
};
export default function (state = initialState, action) {
switch (action.type) {
case WATCH_DETAILS[SUCCESS]:
return reduceWatchDetails(action.response, state);
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment