Carlos Muñoz

11/11/2019, 10:55 AM
Hello everyone! Seeking for some validation / feedback on the following idea that becomes possible thanks to Compose (took some ideas from the official sample): - Single activity, single viewmodel that just receives actions from screen components: - View model just contains Action handlers, passed down to the screen @Composable: - Action + currentState = new State. Handled in reducers: - A parent state to handle the current screen: - One state object per screen, allowing feature modularization: Some open questions: - Where to notify when a "screen is created" to trigger initialization? - Is it the ViewModel really necessary here, since the state objects could keep the state themselves? - In general, do you see this navigation pattern scalable?

Ryan Mentley

11/11/2019, 9:18 PM
I'd be concerned about storing so much state as members of singleton
- I don't think that's going to scale, for the same reasons that storing static state has issues outside of Compose

Carlos Muñoz

11/12/2019, 10:56 AM
Definitely one of my main concerns as well
Thanks Ryan!
Any suggestions to make something along this lines scalable? or having an activity / fragment container per screen will still be the way to go in Compose : )