Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1946

Allow using `...` operator to shallow copy a record without rewrite any fields

$
0
0

I’d argue that it’s not very normal or useful. If you use immutable patterns throughout your code, you don’t need it at all, so all you achieve by rest spreading is unnecessary GPU/memory load (including unnecessary rerenders/effects firing in React).

If you have to copy due to interop with some code that mutates your records, you can always bind to Object.assign. Sure, it’s more of an eyesore, but I suppose places like this should stick out.


Viewing all articles
Browse latest Browse all 1946

Trending Articles