Skip to content

Make the state readonly #1617

@jon9090

Description

@jon9090

I work with people who are not so smart, and they intend to make mistakes even though I explain to them.

For example:

loadSomething() {
   this.get().accounts = null;
   ...
}

The problem with that code, the state is changing unexpectedly and not by the rx-state flow (connect, hold), because of the rx-state reactivity. and because I get the actual state, I can change that because it references to the origin source.

The solution to prevent that is to make the state read-only.

I want to prevent them to do that mistake. in Redux/ngrx the state is read-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions