Hacker News new | ask | show | jobs
by ui4jd73bdj 1646 days ago
I would imagine it would help more with nested objects.

({ contact: { address: "" } })

as opposed to

({ ...prev, contact: { ...prev.contact, address: "" } })

2 comments

For deeply nested data, I would probably use `immutability-helper`. Many deep spread operators can get ugly and confusing pretty quickly, in my experience.
I guess how you should handle that is ambiguous. Probably best to be explicit for that reason.