Hacker News new | past | comments | ask | show | jobs | submit login

I put viewmodel state with the app state - my app state basically is viewmodel state, domain state source of truth is the database really, so you need to do ajax to traverse the domain object graph, its not stored on the client.

Just like you want to control a react.dom.input, you also may want to control a tabstrip. Maybe you have some biz logic that says "When you click save, select the next record, and if record.type===2, select the third tab". You never know in advance what state needs to be controlled from the top, I found myself refactoring my viewmodel state higher and higher.

The mouse state is never going to be controlled from the top, so that is component local state.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: