Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created April 14, 2016 08:59
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 lesniakania/416abb8722ad6985c30576b1b181e7d3 to your computer and use it in GitHub Desktop.
Save lesniakania/416abb8722ad6985c30576b1b181e7d3 to your computer and use it in GitHub Desktop.
import ActionTypes from '../constants/ActionTypes';
let SubmissionsReducer = (state = {}, action) => {
let newState;
switch (action.type) {
case ActionTypes.RECEIVE_SUBMISSIONS_LIST:
newState = {};
action.submissions.forEach((s) => {
newState[s.id] = s;
});
return newState;
default:
return state;
}
};
export default SubmissionsReducer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment