Immutability Benefits

John Peters - Nov 19 '19 - - Dev Community

Please add to the conversation by writing a little bit about why you feel Immutability is such a good idea. Please!

I recently used an Angular component, whereby it contained a table of data, immutable data. I found out later that the only way to change any row being displayed was to make a copy of the row to be edited by the user, show it in another control, then to mutate the entire collection with the new value inserted once the user made the change.

In the past, we would just mutate the data and save it off to the data store. Never had issues with that in 25+ years.

I feel the work to get the immutable data to mutate was way more work than just changing the row that needed it.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player