Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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