News for hackers. Stuff that matters.
Re:A better way to represent loading state in ReactJS/Redux ... by yeasayer on Sunday June 18, 2017 @04:43AM (#14579679)
Relying on JS illogical behaviour:

  [] === [] // false
It's more confusing and error prone than other options mentioned in the article.
Re:A better way to represent loading state in ReactJS/Redux ... by inimino on Sunday June 18, 2017 @11:17AM (#14580993)
I understand it's popular to heap abuse on any and all JS features, but please don't jump on that bandwagon.

There's nothing whatsoever illogical about two mutable objects that are not identical being reported as unequal, and it's hard to think of any language that has mutable values at all where there isn't an equivalent feature.

Re:A better way to represent loading state in ReactJS/Redux ... by rpeden on Sunday June 18, 2017 @07:49AM (#14580253)
I don't think that particular example is illogical. it's basically the same as writing something like

    new String[1] == new String[1]
in Java, which would also be false.
Re:A better way to represent loading state in ReactJS/Redux ... by mpodlasin on Sunday June 18, 2017 @04:59AM (#14579724)
I will just add that even though I disagree with proposition of that article, understanding this JS behavior is key in writing big redux apps, since it is main source of wasted renders optimizations. If you do it wrong, whole app might rerender on smallest changes.