by spion · 11y ago · 0 comments
immutableEq(a1, a2) {
return (a1 === a2) || all(mapPair(a1, a2, immutableEq))
}
Now if you update the value of a single element in the array a2, you would not have to check all the elements in depth (only their references): a1 = Immutable.List(el1, el2, el3, el4, el5)
a2 = a1.set(2, Immutable.Map({hello: "world"}));
immutableEq(a1, a2) // all but el3 compared by reference equalityIf you have a pipeline then it's going to result in everything downstream re-running, unless you compare the output of the map() transformation to the previous value, like some build systems do.