Replies: 1 comment
-
There is added solution in official documentation which touches this problem. Haven't had time to test it yet. Closing this for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i would like to ask for a solution to fairly common problem tied to withObservables.
official documentation states this:
My issue is, that i would like to handle case, when i have relation on model and i want observe it in withObservables.
But what if relatedModel does not exist? Or what if even myModel does not exist.
i tried simple
myModel?.relatedModel || of(null)
which should also be the result i am looking for pretty much (or even better would be "simple" null)I am fairly unfamiliar with Rxjs, but i tried to solve this in quite a few different ways, but none was successful.
I always end up with error relatedModel#1 not found which means complete crash of app.
Tried using defer, map, switchMap, pipe, nothing was working for me. Is there any way to handle this?
I know i can solve this by using query(), but i believe there should be more elegant solution for this which i struggle to find.
Beta Was this translation helpful? Give feedback.
All reactions