You also have to figure out how you are going to deal with debugging access to the state. Sometimes you don't even know who is modifying the state. Add in asynchronous programming, and you have all kinds of modifications going all in all kinds of orders from all over the place and you have to figure out:
the order of the modifications
who performed them
how they modified them
So the state manager adds that in as well. You can add getters and setters and enforce synchronous programming in certain methods, but then you are 90% towards a state manager.
the order of the modifications
who performed them
how they modified them
So the state manager adds that in as well. You can add getters and setters and enforce synchronous programming in certain methods, but then you are 90% towards a state manager.