This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClubsViewModel<T> @ViewModelInject constructor(clazz: Class<T>) : BaseViewModel<T>(clazz) { | |
listenToFireStoreCollection("Clubs", _mClubs) | |
... | |
} | |
class BViewModel<T> @ViewModelInject constructor(clazz: Class<T>) : BaseViewModel<T>(clazz) { | |
private var _mBs = MutableLiveData<List<T>>() | |
listenToFireStoreCollection("Bname", _mBs) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CURRENT POSITION | |
class ClubsViewModel<T> (clazz: Class<T>) : BaseViewModel<T>(clazz) { //<< THIS IS WHERE THE CURRENT PROBLEM WAS. | |
private var _mClubs = MutableLiveData<List<T>>() | |
listenToFireStoreCollection("Clubs", _mClubs) | |
... | |
} | |
class BViewModel<T> (clazz: Class<T>) : BaseViewModel<T>(clazz) { //<< THIS IS WHERE THE CURRENT PROBLEM WAS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//INITIAL POSITION | |
class ClubsViewModel(): BaseViewModel() { | |
private var _mClubs = MutableLiveData<ArrayList<ClubFSEntity>>() | |
... | |
private fun listenToFireStoreClubs() { | |
mFirestore.collection("Clubs").addSnapshotListener { snapshot, e -> | |
// if there is an exception we want to skip. | |
if (e != null) { | |
return@addSnapshotListener |