Created
August 9, 2017 20:31
-
-
Save maxired/53c18a9796bd3b0ec61441a171895f00 to your computer and use it in GitHub Desktop.
extract of https://stackoverflow.com/a/37266130 using lodash fp set
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
const store = createStore((state = {repoIds, reposById}, action) => { | |
switch (action.type) { | |
case UPDATE_TAG: | |
return set('reposById.1.tags[0]', {id: 213, text: 'Node.js'}, state); | |
default: | |
return state; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment