Created
April 26, 2017 12:52
-
-
Save gnaeus/559de1fc18c3832ba569cba873a3a82a 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
function usersReducer(state, action) { | |
switch (action.type) { | |
case CHANGE_NAME: | |
const { id, name } = action.payload; | |
return { | |
byId: { | |
...state.byId, | |
[id]: { | |
...state.byId[id], | |
name: name, | |
} | |
} | |
allIds: state.allIds, | |
}; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment