Hacker News new | ask | show | jobs
by lioeters 2645 days ago
I agree with that logic, I think I've encountered every one of those cases.

That makes me see that there isn't a "god" object like the article calls it, that holds all of the app state. There's the root state shared throughout the app, and then each page or component can have its own encapsulated state.

Ideally I like to also keep page- or component-specific state+actions decoupled from their views, functional and testable independently - but often I start/keep them in the component class (and maybe soon hooks).