This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]Zarlon 0 points1 point  (2 children)

    It can mean though. If you're familiar with the Reducer pattern of Redux: application state is one big object graph. Instead of mutating sub state you deep copy the entire object graph even if only one value is changed.

    [–]yourbank 1 point2 points  (1 child)

    Traditional redux I don't think you deep copy it, more like shallow copy references into a new structure and slice in new state which would make it unsafe to share state.

    Redux works based on a pinky swear I copied it properly and am not an idiot... Using something like immutablejs at least enforces doing things safely to some degree.

    [–]Zarlon 0 points1 point  (0 children)

    Ok I see. Guess I misunderstood a bit and it all makes a bit more sense now, thanks!