Created
December 21, 2019 15:26
-
-
Save gastsail/21b281edbb090b97f2580a66827c4a41 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun getEventsDB(): LiveData<MutableList<Event>>{ | |
val data = MutableLiveData<Mutablelist<Event>>() | |
val myList = mutableListOf<Event>() | |
FirebaseFirestore.getInstance() | |
.collection("events") | |
.get().addOnSuccessListener { | |
// Get results | |
FirebaseFirestore.getInstance().collection(id).get().addOnSuccessListener { | |
... | |
}.addOnFailureListener{ | |
... | |
} | |
}.addOnFailureListener{ | |
// Handle exceptions | |
} | |
return data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment