Skip to content

πŸš€: Runtime immutability checks for StateΒ #211

@Nek-12

Description

@Nek-12

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions