Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested calls, this way is correct? #90

Open
padrecedano opened this issue Nov 29, 2021 · 0 comments
Open

Nested calls, this way is correct? #90

padrecedano opened this issue Nov 29, 2021 · 0 comments

Comments

@padrecedano
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant