How to pass parameters of more than one API Methods to ViewModel

144 Views Asked by At

I'm using ViewModelFactory to pass API method input parameters to my ViewModel Class as someone told HERE, but my question is what should I do to send parameters of more than one API method to ViewModel?

Is it OK to call more than one API method in a ViewModel or I should create a ViewModel for every API Method?

1

There are 1 best solutions below

4
On

my question is what should I do to send parameters of more than one API method to ViewModel?

It would make more sense to use dependency injection. (Dagger Hilt - ViewModel)

Is it OK to call more than one API method in a ViewModel or I should create a ViewModel for every API Method?

I recommend using Repository Pattern.