NOTE: when we observe the graph, it is important to do this synchronously
to not mess with mobx. Since most of the indices of the graph are computed values
we have seen cases where asynchronousity hurts us and causes really ellusive bugs
since mobx observabilty does not track in asynchronous context and makeObservable
is sort of equivalent to triggering observability.
On the other hand, for performance purpose, we would need to observe all of graph
elements asynchronously, as such, we would do that separately in the method
observe_GraphElements
NOTE: when we observe the graph, it is important to do this synchronously to not mess with
mobx
. Since most of the indices of the graph are computed values we have seen cases where asynchronousity hurts us and causes really ellusive bugs sincemobx
observabilty does not track in asynchronous context andmakeObservable
is sort of equivalent to triggering observability.See https://mobx.js.org/understanding-reactivity.html#understanding-reactivity See https://github.com/finos/legend-studio/issues/1121
On the other hand, for performance purpose, we would need to observe all of graph elements asynchronously, as such, we would do that separately in the method observe_GraphElements