How to get data from api using Retrofit through ViewModel
The ViewModel class is designed to store and manage UI-related data so that the data survives configuration changes such as screen rotations.
https://developer.android.com/topic/libraries/architecture/adding-components.html
*Avoid memory leaks.
*we don't have to save objects when orentation changes.
*don't load data again and on every recreate.
*Help to minimize resources reuse.