Other unrelated `navigation-compose` question: Is...
# compose
j
Other unrelated
navigation-compose
question: Is it possible to scope a
viewModel()
to a nested navigation graph? (So that 2 screens in a nested graph can share state without making that state “global”)
Use case: There are 3 screens: A -> B -> C B and C must share some state without making it globally accessible (i.e. A shouldn’t be able “see” it).
a
What about having B & C with their own viewModel that have a class Z injected and scoped to these vm?
j
How would you handle the case where you have multiple instances of B? Each couple (B,C) must receive a separate instance of Z.
s
How about using B's ViewModel in C? but i think it's not right approach also.