Hi! I got a question about scopes + viewModel. I h...
# koin
m
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
What is your usecase to need scope for ViewModels?
m
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).
Any workarounds or suggestions, maybe i'm wrong in my throughts?