Created
July 19, 2015 14:30
-
-
Save baio/ec100d895bb5de260eb4 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
var list1 = Immutable.fromJS([{a: 10}, {a : 20}]); | |
var list2 = Immutable.fromJS([{a: 10}, {a : 20}]); | |
//var list2 = list1.merge(list2); | |
var list3 = list1.mergeDeep(list2); | |
var newVal = [{a: 10}, {a : 20}]; | |
var list4 = list1.update(function (value) { | |
var nv = Immutable.fromJS(newVal); | |
return Immutable.is(list1, newVal) ? value : nv; | |
}); | |
console.log(list1 === list3); | |
console.log(list1 === list4); | |
console.log(list3.toJS()); | |
console.log(Immutable.is(list1, list3)); | |
console.log(Immutable.is(list1, list4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment