4 ms·
Referential equality is possibly an optimization, and makes re-rendering efficiently at least simpler. Debugging and rewind/replaying application state is also
by kochthesecond 9y ago
Referential equality is possibly an optimization, and makes re-rendering efficiently at least simpler.
Debugging and rewind/replaying application state is also greatly simplified by keeping states immutable.
Having the state mutable would also need some kind of locking between the render view and updateState method
- rbalicki 9y agoYou're certainly right that in the mutable Rust land you don't have rewind/replaying state out of the box.
- vvanders 9y ago> Having the state mutable would also need some kind of locking between the render view and updateState method You may want to brush up on Rust, the language has been designed explicitly to deal with these kinds of situations.
- littlestymaar 9y ago> Having the state mutable would also need some kind of locking between the render view and updateState method That's right, but that's exactly the main strength of Rust : the borrow checker deals with that locking at compile time with zero runtime overhead. Not arguing on the other points though.