Libraries like Mavericks provide optional runtime checks to verify that the State object has not been accidentally mutated (e.g. by modifying a nested mutable list). Since FlowMVI relies heavily on immutability for thread-safety, providing an opt-in runtime check would prevent subtle bugs in large teams.
Ideas:
- Create a debug-only plugin that verifies state immutability on each
updateState call (e.g., using reflection or checking for common mutable types).
- Throw a loud error if a mutable collection is detected inside the state data class during debug builds.
Libraries like
Mavericksprovide optional runtime checks to verify that the State object has not been accidentally mutated (e.g. by modifying a nested mutable list). Since FlowMVI relies heavily on immutability for thread-safety, providing an opt-in runtime check would prevent subtle bugs in large teams.Ideas:
updateStatecall (e.g., using reflection or checking for common mutable types).