Skip to content

Nested calls, this way is correct? #90

@padrecedano

Description

@padrecedano

Thanks for this tool. It is very useful especially for those of us who have little knowledge of RXJava.

In my case I need to make nested calls: read a first document where I have the reference to another document.

I am doing it like this:

    FirebaseFirestore firestore = FirebaseFirestore.getInstance();
    DocumentReference parentRef = firestore.document("path/to/parent/document");

    RxFirestore.observeDocumentRef(parentRef)
            .subscribe( parentData -> {
                DocumentReference childRef = parentData.getDocumentReference("reference/i/need");

                RxFirestore.observeDocumentRef(childRef)
                        .subscribe( finalData -> {
                            Log.d("bbbb",finalData.toString());
                        });

            });

The code works, in the second observeDocumentRef I can see the Log with the data, but I want to know if this form is correct. I have no knowledge of RXJava and I do not know if making calls like this with this library could give a problem. If not correct, how can I safely make nested calls?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions