Advertisement
Guest User

Untitled

a guest
May 25th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class MainViewModel @Inject constructor() : ViewModel() {
  2.  
  3. @Inject
  4. lateinit var repository: Repository
  5.  
  6. private val loadUser: MutableLiveData<User> by lazy { MutableLiveData<User>() }
  7.  
  8. val loadLiveUser: LiveData<User> by lazy { loadUser }
  9.  
  10. fun load() {
  11. ioThread {
  12. loadUser.postValue(repository.load())
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement