DEV Community

Discussion on: What Do You Think About Immutable Data?

Collapse
 
nektro profile image
Meghan (she/her)

have you seen Object.freeze?

Collapse
 
_sburnicki profile image
Stefan Burnicki

Indeed I didn't, thanks!
It even seems to be supported by typescript as the type definition returns a ReadOnly (stackoverflow.com/questions/486298...).

Makes me wonder why libraries like ngrx don't take advantage of this.

I will definitely try to use that one.