I have a question about delivering data backwards ...
# compose
c
I have a question about delivering data backwards Let's say there are A, B, C Screens and UserInfo data starts in A. And I'd like to deliver it to C. And at B or C Screen you can change the value of UserInfo. And when you pop from C->B or B->A, it must show the changed value. After C, userInfo will be useless because the app provides one direction process with different users each time. How can I deliver data in this situation?
c
@Sean Proctor Well, Should I use repository? I don't want to store it in preference or room or server. I want to just pass it and remember or ViewModel would be enough to keep the data.
s
If you use the same ViewModel for both screens, that works. Otherwise you need to store the data somewhere both ViewModels can access it. I would use a repository that is injected into your ViewModels.