talk-android
talk-android copied to clipboard
ContactsViewModel shouldn't retrieve all users in the constructor
The ContactsViewModel is currently retrieving users on object creation
init {
getContactsFromSearchParams()
}
which isn't inherently bad, but when used with our dependency injection setup, each @Inject creates a new instance of the class, which means that unnecessary network calls are made with entering activities that may rely on the functions exposed through the view model, but are not immediately requiring the entire contacts list of the user.