Guest User

Untitled

a guest
Jan 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. class TeamViewModel : ViewModel(), CoroutineScope {
  2. //...Rest of TeamViewModel
  3. private lateinit var teams: MutableLiveData<List<Team>>
  4.  
  5. fun getTeams(): LiveData<List<Team>> {
  6. if (!::teams.isInitialized) {
  7. teams = MutableLiveData()
  8. }
  9. return teams
  10. }
  11.  
  12. private lateinit var isLoading: MutableLiveData<Boolean>
  13.  
  14. fun getIsLoading(): LiveData<Boolean> {
  15. if (!::isLoading.isInitialized) {
  16. isLoading = MutableLiveData()
  17. }
  18. return isLoading
  19. }
  20.  
  21. private lateinit var showError: MutableLiveData<Boolean>
  22.  
  23. fun shouldShowError(): LiveData<Boolean> {
  24. if (!::showError.isInitialized) {
  25. showError = MutableLiveData()
  26. }
  27. return showError
  28. }
  29. //...Rest of TeamViewModel
  30. }
Add Comment
Please, Sign In to add comment