making and every tab is a fragment. And every fragment has view model associated with it. But every viewmodel has almost the same use except changing arguments. So is there a way not to duplicate viewmodel?
Hello @yohan_nes . You can create a Base ViewModel and have the others inherit from it.
Wait i still need many viewmodels right?
It depends. If the majority of the viewmodels have the same default behaviour, you use the BaseViewModel to avoid duplication.
Обсуждают сегодня