Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- suspendCoroutine { continuation ->
- FirebaseFirestore
- .getInstance()
- .collection("products")
- .get()
- .addOnSuccessListener {
- continuation.resume(
- Either.Right(
- it.toObjects(Product::class.java)
- )
- )
- }
- .addOnFailureListener {
- continuation.resume(
- Either.Left(
- Failure.ServerError(it)
- )
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement