"TheEndless" wrote:
Now, consider you have a ContentNode that provides the content for multiple grid components (grid1 and grid2). Each grid component may want to register an observer on the ContentNode to monitor for any changes to the data, so it can update its UI. If unobserveField() were nuclear, then grid1 would have no way unregistering its observer when its ContentNode (or visibility) changes without also unregistering grid2's observer.
... except that is exactly what
unobserveField() does. Putting the record straight,
unobserveField() is the "nuclear option" and will annihilate all observers on that component field.
Which is why in 7.5 another set of methods -
observeFieldScoped() / unobserveFieldScoped() - was added, which maintains list of observer fn/ports local to the caller, so the flushing would be local in scope. Likewise, it does not provide individual opt-out - if the same component has set two observers on another component.field, both will be removed with unobserveFieldScoped().