Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. suspendCoroutine { continuation ->
  2. FirebaseFirestore
  3. .getInstance()
  4. .collection("products")
  5. .get()
  6. .addOnSuccessListener {
  7. continuation.resume(
  8. Either.Right(
  9. it.toObjects(Product::class.java)
  10. )
  11. )
  12. }
  13. .addOnFailureListener {
  14. continuation.resume(
  15. Either.Left(
  16. Failure.ServerError(it)
  17. )
  18. )
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement