'Is it best practice to store UI data in Repository instead of SharedViewModel?
Let's say I have 3 screens (3 fragments) with its own form input fields and the last screen will display all form data that collected before so these form data need to be stored at somewhere before reaching the last screen.
And these form data no need to be persisted, users have to start from the beginning again to fill the form when coming to this feature.
Should I store this data from each fragment into SharedViewModel or Repository?.
It works on both solutions but I'm trying to follow mvvm + clean architecture and I'm thinking about what is the best practice to follow in this scenario.
Any suggestions would be greatly appreciated.
Thank you so much
Solution 1:[1]
I think you can use SharedViewModel. Using a repository in your case is unnecessary.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Frengky |
