Creating a Copy of an Immutable Object with Modified Properties
I use Data.struct(...) to create my immutable object. I want to copy that object with modified properties. I came from Scala, there's a method copyWith(..) which creates a copy with updated properties. How can I achive the same? I tried to use spread operator
{...myObject}
{...myObject}
in order to get rid of Struct and get plain object, but the new object has readonly fields also