The section on visibility scopes for subjects could be improved, as I think this might be a stumbling block, but it's important for people to understand.
Several possible solutions
- I believe we should change the node for
NewScope to a higher-order observable that does create a new scope, like CreateObservable. CreateObservable is a good candidate for this, as it has been covered in the previous article on higher-order observables, and I think it is a bit more intuitive for people to understand a possible situation where a new scope is being declared.
- Another alternative is to have in the screenshot examples of several nested operators that share the same scope as the outer workflow (I believe only
IncludeWorkflow and GroupWorkflow operators) and other operators like CreateObservable, Defer, and SelectMany.
Another point is that the example screenshot does not illustrate how scopes work, and the text is a little hard to understand for a beginner.
- We could build out a more complete working example. For instance, by using the same example from the beginning of the article (a
PublishSubject from a CameraCapture) and comparing how it works in a GroupWorkflow and a Defer.
Another common question that people ask is also how to share a subject that is in an inner scope with the outer scope, and it might be nice to add that one can declare the subject in the outer scope first (with a source subject) and cast to it in the inner scope. See https://github.com/orgs/bonsai-rx/discussions/1676. However, this might be out of "scope" for this revision (haha).
Some additional comments here that I have yet to digest, but which might be nice to add.
The section on visibility scopes for subjects could be improved, as I think this might be a stumbling block, but it's important for people to understand.
GroupWorkflownodes, which I believe always share the same scope, and that it is not possible to make one with a new scope. I noted this down in Update workflow images to workflow containers #96. Others have also encountered the same issue https://github.com/orgs/bonsai-rx/discussions/1664.Several possible solutions
NewScopeto a higher-order observable that does create a new scope, likeCreateObservable.CreateObservableis a good candidate for this, as it has been covered in the previous article on higher-order observables, and I think it is a bit more intuitive for people to understand a possible situation where a new scope is being declared.IncludeWorkflowandGroupWorkflowoperators) and other operators likeCreateObservable,Defer, andSelectMany.Another point is that the example screenshot does not illustrate how scopes work, and the text is a little hard to understand for a beginner.
PublishSubjectfrom aCameraCapture) and comparing how it works in aGroupWorkflowand aDefer.Another common question that people ask is also how to share a subject that is in an inner scope with the outer scope, and it might be nice to add that one can declare the subject in the outer scope first (with a source subject) and cast to it in the inner scope. See https://github.com/orgs/bonsai-rx/discussions/1676. However, this might be out of "scope" for this revision (haha).
Some additional comments here that I have yet to digest, but which might be nice to add.