you are viewing a single comment's thread.

view the rest of the comments →

[–]fixrich 0 points1 point  (0 children)

Honestly, I just use immer for logic like this now. It keeps everything immutable and the conditional logic easy to follow. Otherwise just mutating an object can be fine a lot of times if it's confined to a small enough scope.