Created
April 5, 2018 16:17
-
-
Save nanlabsweb/4ddf62e9f0ce18016b085d8e21504eba to your computer and use it in GitHub Desktop.
Get data from firestore.
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
fun getAllPets(): LiveData<List<Pet>> { | |
var pets: MutableLiveData<List<Pet>> = MutableLiveData() | |
firestoreDataBase.collection("pets").get().addOnSuccessListener { | |
pets.value = setPetsFromSnapshotIntoMutableList(it) | |
} | |
return pets | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment