Hi! I got a question about scopes + viewModel. I have two fragments, and for both I have two scopes(smth like
Copy code
scope(qualifier = named<Fragment1>()) { ... }
Also I want to share one viewModel between them. I found that I need t create one more scope with viewModel and link it with both fragment's scopes. Is it a good practise? Any suggestions how to do this correctly?
Also they are not parent and child. It's two different fragment in navigation graph
a
arnaud.giuliani
07/15/2021, 7:46 AM
What is your usecase to need scope for ViewModels?
m
Merseyside
07/16/2021, 3:43 AM
I don't need it exactly for viewModels. I just use it for each fragment and every fragment has it's own viewModel declared inside scope block. Now i have a few fragments with the same logic(registration).
Merseyside
07/21/2021, 4:59 AM
Any workarounds or suggestions, maybe i'm wrong in my throughts?