Slide 4
Slide 4 text
seamless-immutableͷྫ
Immutable([3, 1, 4]).sort()
// ImmutableError sort()͕immutableͳϝιουͰͳ͍ͨΊ
Immutable([1, 2, 3]).concat([10, 9 , 8]).sort()
// ImmutableError concat()͕immutableͳϝιουͰͳ͍ͨΊ
[1, 2, 3].concat(Immutable([6, 5, 4])).sort()
// [1, 2, 3, 4, 5, 6]
// concat()͕mutableͳArrayΛฦͨ͢Ί
var obj = Immutable({all: “your base”, are: {belong: “to them”}});
Immutable.merge(obj, {are: {belong: “to us”}})
// Immutable({all: “your base”, are: {belong: “to us”}})
4