Created
October 5, 2016 05:00
-
-
Save BenjaminVerble/86d06fc2f9d94aa647a96e47ccdb6254 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 Immutable from 'immutable' | |
const nested = Immutable.fromJS({a:1, b:2, pieces:[]}) | |
const nested2 = nested.updateIn(['pieces'], list => list.push({player: 'player1'})); | |
const nested3 = nested2.updateIn(['pieces'], list => list.push({player: 'player2'})); | |
bin.log(nested3.toJS()) | |
const nested4 = nested3.updateIn(['pieces'], list => list.pop()) | |
bin.log(nested4.toJS()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment