Created
October 5, 2016 05:00
-
-
Save BenjaminVerble/86d06fc2f9d94aa647a96e47ccdb6254 to your computer and use it in GitHub Desktop.
Revisions
-
Benjamin Verble created this gist
Oct 5, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ 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())