Created
April 14, 2016 08:59
-
-
Save lesniakania/416abb8722ad6985c30576b1b181e7d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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