Last active
July 12, 2017 03:36
-
-
Save dbani-dev/f25485ff943c5d377a7a1777448f7111 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 initialState = Immutable.fromJS({ | |
status: null, | |
error: null, | |
items: Immutable.List([]), | |
nested: { | |
test: 'a', | |
groups: { | |
users: [] | |
} | |
} | |
}) | |
const updateState = initialState | |
.set('status', 'active') | |
.set('error', false) | |
.update('items', (list: any) => list.push('a', 'b', 'c')) | |
.update('items', (list: any) => list.delete(list.keyOf('b'))) | |
.setIn(['nested', 'groups', 'users'], Immutable.List([1, 2, 3])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment