Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 14, 2018 20:45
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/6fb7ec82d86977b6dbd09cafdde8e737 to your computer and use it in GitHub Desktop.
Save productioncoder/6fb7ec82d86977b6dbd09cafdde8e737 to your computer and use it in GitHub Desktop.
Youtube in react: comments reducer
import {SUCCESS} from '../actions';
import {WATCH_DETAILS} from '../actions/watch';
const initialState = {
byVideo: {},
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