Skip to content

Instantly share code, notes, and snippets.

@TorkelV
Created February 24, 2021 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TorkelV/8b377afe6e6eeede1b45b4d056237f20 to your computer and use it in GitHub Desktop.
Save TorkelV/8b377afe6e6eeede1b45b4d056237f20 to your computer and use it in GitHub Desktop.
override fun getLeaders(lastVisibleItem: Flow<Int>): Flow<List<User>> =
collection("users")
.whereGreaterThan("points", 0)
.orderBy("points", Query.Direction.DESCENDING)
.paginate(lastVisibleItem)
.map { docs -> docs.map { it.toUserDto().toUser() } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment