That is a very good question.
Roman Liutikov
1

I’ve yet to read a realistic discussion of the “shared mutable state problem” that can’t be handled by a proper event or states & statecharts system controlling it. React and immutable vs react and mutable come across to me as the same thing because what is important is the dispatcher (Flux, Redux, whatever) informing everybody else that the mutable object has changed.

The pattern is the event, immutable vs mutable becomes immaterial when you have a proper event system telling you that there’s something new or different.

THAT is why I’m not really sold on immutability as a solution to much of anything, because it *alone* doesn’t solve anything. You’re creating more objects, with all these old versions of things hanging around all over the place, but without the event system to tell the rest of the app they should be using some new version of the object, it doesn’t mean anything. And if they have that event system in place (and are in a single-threaded environment like javascript) then it doesn’t matter that the object they are holding has changed, because they have been informed of it.

Show your support

Clapping shows how much you appreciated Joe Shelby’s story.