Skip to content

Instantly share code, notes, and snippets.

@ivanalvarado
Created May 10, 2019 04:11
Show Gist options
  • Save ivanalvarado/31e9ecf86e2c8e14f4bf52bd18d65d57 to your computer and use it in GitHub Desktop.
Save ivanalvarado/31e9ecf86e2c8e14f4bf52bd18d65d57 to your computer and use it in GitHub Desktop.
Naive implementation of Swipe-to-Refresh with LiveData.
class UserListViewModel @Inject constructor(private val userRepository: UserRepository) : ViewModel() {
init {
}
// DON'T DO THIS
fun getUsers(): LiveData<List<UserModel>> {
return userRepository.getUsers()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment