Created
May 17, 2018 04:45
-
-
Save w9jds/9697b730a275fbdab294468a94f66fe3 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
private val valueHandler = object: ValueEventListener { | |
override fun onDataChange(snapshot: DataSnapshot?) { | |
groups.value = snapshot?.children?.distinct() ?: emptyList() | |
loadFinished() | |
} | |
override fun onCancelled(error: DatabaseError?) { | |
groups.value = emptyList() | |
loadFinished() | |
} | |
} | |
firebase.getReference("types/$groupId").orderByChild("name").addListenerForSingleValueEvent(valueHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment