Shared view model is a common pattern, when you use activity's VM in the fragment. What if the fragment itself has a viewmodel and they need to communicate? Do you link them on the fragment level, or you pass activity VM inside the fragment VM?
01/08/2019, 6:39 PM
I'm working on a project where I passed the activity VM to the fragment VM when its constructed. That worked fine for me, though I'm not sure if it introduced any memory issues...
01/08/2019, 11:13 PM
Maybe a VM reducer?
01/09/2019, 6:08 AM
@sam so you mind to elaborate?
01/09/2019, 2:42 PM
Basically what you said something that's taking in two ViewModels at the fragment level and giving you back the state you need