Last active
December 25, 2019 07:54
-
-
Save cpv123/7114d3918dedcca5b6c46f513bb3e4a5 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
// Immutable() when using seamless-immutable; Immutable.fromJS() when using ImmutableJS | |
const initialState = Immutable({ | |
todos: { | |
'a': { id: 'a', description: '...', isComplete: false }, | |
'b': { id: 'b', description: '...', isComplete: false } | |
} | |
}) | |
const reducer = (state, action) => ( | |
state.setIn(['todos', action.todoId, 'isComplete'], action.payload) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment