by having immutable data you can guarantee atomic access to you application's state. Not only does it means that you will eliminate race conditions where you read a value as it's being changed, you also make it safe to access the same resource from different processes.
Programming languages enthusiast. Author of Learn Type Driven Development: https://www.packtpub.com/application-development/learn-type-driven-development
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
by having immutable data you can guarantee atomic access to you application's state. Not only does it means that you will eliminate race conditions where you read a value as it's being changed, you also make it safe to access the same resource from different processes.
Jose, does "different processes" mean multiple asynchronous access to the same data?
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
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.