DEV Community

Discussion on: Immutability Benefits

Collapse
 
jwp profile image
John Peters

Jose, does "different processes" mean multiple asynchronous access to the same data?

Collapse
 
yawaramin profile image
Yawar Amin

That's right. In the browser/node this can happen due to async stuff like promises resolving at different times.

By the by, your table data structure may be the wrong one–it sounds like changing a row was not easy. You may want an immutable tree structure to store the table. It can make replacing rows very easy. See this great explanation of such a data structure: youtu.be/Wo0qiGPSV-s

Thread Thread
 
jwp profile image
John Peters

Thank you for your input Yawar!

You are saying, Immutability is good because of Asynchronous data concerns. The concern of multiple async jobs not knowing the state of the data.